Jump to content
GreenSock

speedfontain

Reusing Videoloader

Recommended Posts

Hi Team,

 

I am having trouble with memory leakage with the below code, after a few days the flash player runs out of memory and shows a white screen with a (!) in the middle.

 

I have a total of 25 videos, one video is loaded at random every 30 minutes and then unloaded.

 

1. Can I reuse the same loader ?, or should I create a new instance new time.

 

 

var currentVideoMD1:VideoLoader;

function startHarm():void
{

sourceHM = mdm.Application.path + "extensions/harm_" + numberofharmVideosS + ".flv";

currentVideoMD1 = new VideoLoader(sourceHM,{name:"harmvideo1",container:harmTarget.Target_harm_In,x:60,y:626,width:960,height:530,scaleMode:"stretch",bgColor:0x000000,autoPlay:true});
currentVideoMD1.load();

TweenLite.to(currentVideoMD1, 1, {volume:harmminVolume});

currentVideoMD1.addEventListener(VideoLoader.VIDEO_COMPLETE,harmComplete);

}

function harmComplete(e:Event):void
{
currentVideoMD1.removeEventListener(VideoLoader.VIDEO_COMPLETE,harmComplete);
currentVideoMD1.unload();
}

Link to comment
Share on other sites

I would recommend calling dispose(true) on the VideoLoader instance when you're done with it, and just create a new one when you need it. I kinda doubt that's the source of your memory leakage, though. Please give it a shot and let us know if it improves anything.

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.
×