tags:

views:

40

answers:

3

Hi,

I'm moving to a pure as3 environment into flex and I have a question about preloaders.

For one of my apps in particular when the swf loaded I would add a screen with an animated preloader. Then at a particular point in my code when I know all of my xml has been parsed, UI built and all initiliztion done I dispatch a "done" event which removes the preloader.

How can I achieve this is flex? I've only ever really seen flex preloaders that are percentage based which I believe represent the actual loading of the swf itself?

+1  A: 

Please read the flex cookbook for preloaders, they have some demo applications, that could help u out

actually there is a preloader property in the application tag,

that could be wht u might help u out tc

Ankur Sharma

Ankur Sharma
A: 

Flex has a ProgressBar control that you can use for similar purposes. If you want to continue to use your own custom animated progress bar, you can add that Sprite to the rawChildren of a Container (preferably Canvas) and show it as a modal pop-up using the PopUpManager - remove the pop-up from the done event's handler.

The overriden addChild method of the Container class will throw an error if you pass a child that doesn't extend UIComponent - that's why you should use rawChildren.addChild.

Amarghosh
A: 

Yep default flex preloader represents the loading of the swf itself.

If I were you, I would use the Task library from the Cairngorm 3 Libs, works perfectly with a preloader :

http://opensource.adobe.com/svn/opensource/cairngorm3/trunk/libraries/TaskTest/src/samples/TaskFlowPreloader.as

PeZ