views:

23

answers:

2

I am Working on a cs5 as3 project and in that project i have writen all code in the frame1 of main timeline (there is no package/class in the code) The code in the main timeline is very complex in which i am loading external images and xml's and many more things .

i have not written any code in the action layer.

Now i want to add Preloader .

how can i add Preloader in this situation ?

here is a snapshot of the timeline : alt text

+1  A: 

Move everything to the second frame, and add your preloader code/content on the first frame


http://www.google.ca/search?q=preloader+code+as3

Daniel
Ok i moved everything into the second frame and added preloader content on first frame as you said. But What exactly i have to write in preloader code . Please Provide a sample code . Thanks !
S M ADIL
+1  A: 

The real issue here is the number and size of external assets you're loading, it may have been worth considering loading some of these assets separately. In this way, your preloader would have been more accurate. However complex your code is , the loading of the assets is the main element to delay the start of your application.

With your current configuration , if you'd encapsulate the loading of some of the assets (as you may not need all of them right from the start) , you would have been able to directly create a preloader within the code as is , without a DocumentClass, simply by loading assets as your first function and calling an init() method after the loading is complete.

PatrickS