Friday, May 18, 2012

[Action Script] Fully removing SWF from memory May,2012

Hi guys,

I'm completely new to Actionscript. I have worked out the following code to load a new swf...I am trying to make several SWF files load in sequence.

The mobile device I am putting these on, will not replay the same SWF twice, so I am assuming that the code is not properly removing the SWF files from the cache.

Please help if you can!!! Really need some advice.

Here's the code:

ActionScript Code: background_button.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_3);var fl_Loader_3:Loader;var fl_ToLoad_3:Boolean = true;function fl_ClickToLoadUnloadSWF_3(event:MouseEvent):void{    if(fl_ToLoad_3)    {        fl_Loader_3 = new Loader();        fl_Loader_3.load(new URLRequest("part02.swf"));        addChild(fl_Loader_3);    }    else    {        fl_Loader_3.unload();        removeChild(fl_Loader_3);        fl_Loader_3 = null;    }    fl_ToLoad_3 = !fl_ToLoad_3;}
Thanks
Fully removing SWF from memory

Related Post



0 comments: