Jump to content
Search Community

Can't dispose video

CV-Gate test
Moderator Tag

Recommended Posts

Hello, and thanks for reading.

 

I'm making a video player that continuos play clips from a playlist and I would like to dispose the video after playing it. I can't configure autoDispose:true because I still need it for some seconds when the next video is playing, this is the code I'm trying:

 

//add cuepoint

 

var oldVideo:Number = _videos.indexOf(_currentVideo) - 1;

_currentVideo.addASCuePoint(1, "removeVideoCP", {n:oldVideo});

 

 

//.....

 

 

// get message from cue point

 

if (event.data.name == "removeVideoCP")

{

var _videoID:Number = event.data.parameters.n;

//_videos:Array of VideoLoaders

_videos[_videoID].dispose();

trace(_videos[_videoID].name);

// this still traces "clip1"

}

 

Any idea?

 

 

Thanks a lot for your help.

Link to comment
Share on other sites

I think you might be misunderstanding what dispose() does. It basically trashes all the internal guts that hold on to references to the loaded content, dumps internal loaders, unregisters it from the root LoaderMax, etc. It does NOT change all the property values like "name". And the instance still exists until it gets gc'd which only happens after you remove your references that are pointing to it and Flash decides to run its gc routine. Again, this isn't anything I can control.

 

So it's no surprise that the "name" property didn't change, but that doesn't mean dispose() didn't work. See what I mean?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...