This content has been marked as final. Show 6 replies
in as3 you don't load into a movieclip, you use a loader class member as the target of your load and then you add the loader to your display list. if you want something to display on-stage during the load process, you need to add that to the display list, too.
so, unless Carregador is in the display list (ie, it's your document class or you add an instance of it to the display list in your fla), nothing will display.
How would I do if I wanted to load a swf file into the right side of my movie like I did with AS2.0 and empty movie clips?
and I want to show an animation before too..
you can still use as2. just change your publish settings.
there's no reason to use as3 unless you need the performance benefit, you are using some feature of as3 that wan't available in as2 or you want to learn as3.
The following package and class are in use on my site so you can see what it does.... http://www.sd-dezign.com
I am using this exact code to preload a jpeg file (could be any jpg, progressive jpg, gif, png or swf). I just wrote it like 2 days ago. Hope this helps you out.
This is the most basic of preloaders coded in AS3 and part of an external package.
To use the package, it will need to be inside a folder called cloader in the same area as the FLA file that uses it.
The second part is importing the package into the FLA and then calling it with the necessary arguement which is the file you want to load.
The third and final part is to add the preloader to the display list.
Putting it all together, it would look something like this....
First thank you guys for all the answers. I do want to learn AS 3.0 thats why I am struggling with this preloader thing.
Thank you SymTsb for the help and I wanted to preload the main movie first showing a bar and a text field showing the percentage and as soon as my movie gets loaded I want to montionly remove the bar and start my intro.And I also wanted to use the code to load external swf Files showing some animation during the progress bar.
How would I get this done with AS 3.0?Should I make a class or create a function? I use tween motions for the animation.
As I stated before, my example is a bare bones. The text issue is already solved and present in the code I provided. You'd just need to modify it so that you can make it look like you want.
Doing the loading bar is a matter of creating a box and animating its xscale from 0 - 100%. Doing this will require the Tween class. Read up on this stuff in the Flash Help.