Share Posted April 12, 2012 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 More sharing options...
Share Posted April 12, 2012 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 More sharing options...
Author Share Posted April 12, 2012 Yes, I see and you are right. I though that dispose was also removing the instance. Thanks a lot for your answer! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now