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 post Share on other sites
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 post Share on other sites
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 post Share on other sites