3
votes

I want to incorporate a Flash Pre-loader in my application, but I am using only Flex SDK/AS3/Notepad to code this beast. I don't have access to the Flash IDE.

There are many tutorials and helpfiles online for how to do it within CS4, but not in the code itself. Can anyone give me direction here?

Most examples seem to pivot around placing a loader symbol into the first frame, before the rest of your application - but I don't have access to the timeline or frames from within flex (or at least, I don't think I do!).

2
How about this forum tutorial? <defiantmouse.com/yetanotherforum.net/…>dirkgently
Viewing that post requires registration :/Andy Moore
Goto this page <pathf.com/blogs/2008/08/…> and click on the hyperlink on Andrew :Pdirkgently

2 Answers

7
votes

You will want to read about some of the AS3 compiler directives--the relevant one in this case being factory class.

Essentially, you will need to create a class to load your main class that extends MovieClip. The 'preloader' class can monitor the bytesloaded/bytestotal and then instantiate your main class. The non-intuitive portion of this (for me at least) was including the diective: [Frame(factoryClass="pathToYourLoaderClass")]

in the top of your main class you want to preload.

Below is a great blog with more info and a good solution.

http://www.bit-101.com/blog/?p=946

2
votes

For flex applications you set the preloader property of the application. This is usually the boring grey progress bar but can be any display object. Keep in mind though that for the preloader to actually show it has to be loaded and hence needs to be kept small. Thus, it is not recommended to use any classes that are part of the Flex framework as the framework must then be downloaded before the preloader can show.

If you're doing a straight up AS3 project with no Flex at all, then you'll want to take a look at the Frame metadata tag. Look here for more information:

http://www.bit-101.com/blog/?p=946 http://blogs.adobe.com/rgonzalez/2006/06/modular_applications_part_2