Using the AssetManager, you can do it like this.
frame1 :
frame2 : empty frame with label 'loopFrame'Code:// import the required classes import km.core.*; // add a loader object to the stage var myLoader:Loader = new Loader(); addChild(myLoader); // initiate the load AssetManager.loadBinaries('swf1.swf','swf2.swf');
frame3 :
frame4 :Code:if (AssetManager.getQueueLength() > 0) gotoAndPlay('loopFrame');
frame4 is the start of your normal movie.Code:myLoader.loadBytes(AssetManager.getAsset('swf1.swf', false)); stop();
I put a stop action there since this test code contains no further frames. Otherwise you shouldn't put that there of course.
The other line of code loads the swf from a byte array. It's a bit like loading it externally but a lot faster.
The loader object can be reused so in another frame you can use a different line of code to load new content into the same loader object.
Like mentioned in my previous post, you can also choose to add the loader object to mc1 instead of to the stage directly.
If you wish, you can add a dynamic textfield to frame2 and frame3 and add a line of code to frame2 to set the text to the name of the item that is currently being loaded.
AssetManager.getQueueCurrent();
returns a string with the name of that item.




Reply With Quote