PDA

View Full Version : SWFLoader & complex loading requirement


BruceND75
07-30-2009, 05:13 AM
I have a Flex app with a SWFLoader. At present, the Flash SWF being played is large and embedded.

The first screen of the large SWF has some reading to be done. I would like to break the SWF into two parts: The first screen with the text that will show up first, then once it is up, the second part loads.

The first screen has a nav button at the bottom that moves to the next screen. I planned on having the button show up only after the second part is loaded, with a subtle "downloading" flashing where the button would be while the second part is loading. Ideally, the loading will be done by the time the reader finishes reading and is 'ready' for the nav button.

I also plan to move the two swfs to be external files.

I could use some help understanding how to set this up in Flex. I can see having the first SWF load and go to a stop() frame. How do I line up sequential loading, and how do I go about having the second SWF replace the first when the next button is pressed?

Thanks in advance.

wvxvw
07-30-2009, 09:18 AM
I'd use 2 Loaders, add listeners to "complete" event to their contentLoaderInfo, when the listener for the first one fires, I'd start loading the second SWF. When second is loaded, I'll remove the first loader and addChild the second loader.

BruceND75
07-30-2009, 06:54 PM
wvxvw,

Thanks for the suggestion. After considering it, I have developed a more complete sense of what I need.

The outside Flex app is meant to be a swf jukebox, if you will. I want it to be able to handle 'play swf' ops with no entanglements. In my scenario, then, I think that I need to load the first swf, and that swf (which will just contain the text screen) needs to load and listen for end of load.

So now, I could use some help understanding how to have the first swf, after it is loaded, load the second swf "into itself," so that, after the second listener fires, the first swf let's the user have the button to move on.

Sounds like I am now slipping into a Flash instead of a Flex topic, but if I could finish up, here, and get a workable solution, that would be great.

wvxvw
08-02-2009, 08:39 AM
http://livedocs.adobe.com/flex/3/html/help.html?content=modular_6.html
See if this helps you, it should give examples of using ModuleLoader (also, see the docs: http://livedocs.adobe.com/flex/3/langref/mx/modules/ModuleLoader.html ).
Because, if you're going to have Flex SWFs loading each other (that is each SWF makes use of the framework), then modules are your best choice.