00:00
00:00
Newgrounds Background Image Theme

Soultrek just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

As3 Preloder Tutorial

Share Collapse

Author Comments

When i started with flash i decided to do everything meself, even a freaking preloader in Actionscript 3.
I could, however not find a tutorial.
As2, shure, but 3? No.
So I made one.
The preloader is far from perfect, but it works ( not as got as i thought, se the P.S).
This is for all those do-it-yourself loonies as myself, hope it helps.


Fun-fact: I used considerably less time making this than when i was figuring all of this out, canibalising code from completly unrelated tutorials...


Edit:
After installing the Debug player i get the error too.
So I tested the tutorial with the simulate download feature again, and came to the conclusion that it works fine as long as i use a download smaller or equal 2.3 kb/s, (which of course was what i used to test the preloader).
If I however put the fairly big image showing the Turnip on the second frame, everything went smoothly, no matter what kind of download.
I guess the problem was that Flash progresses before the script was loaded, and that this could be solved by somehow telling the flash to load the code before everything else, of which I however do not know how to do it.


Edit 2:
Added a new frame explaining the simulate download and how to avoid the error (not that elegant, but it seems to work).
I used the method myself and the error should be a thing og the past (unless someone has a download speed over 9765.6 kb/s which seems to be the highest simulate-download possible).
I also made a minor change to the explanation of the script.

Log in / sign up to vote & review!

Thanks

I Just used this to create my first ever pre-loader so it definitey works. I even used your method to avoid the simulate downlaod error. Can you possibly explain why it goes white before the preloader starts tho as another Reviewer mentioned?

BlackTurnip responds:

Actually I haven`t got a clue.
Im fairly new to flash myself so all I can do is guess.
One possibility would be that the flash shows the white background while the preloaderimage isn`t loaded yet.
In this case there wouldn`t be much one could do.
However since henke37 used it as a term, this seems unlikely.
The other possibility would be that the flash loads something before the preloader, in wich case one would need to use scripting to tell the flash what to load first. And I do not know how or where.
Of course there could also be a completly different reason.

Lacks deepth

Uhm, aren't programming tutorials supposed to work properly?
And where is the even more interesting stuff? Like how to not get a white preloader and why that happens?
And seriously, do you even know about the smulate download feature in flash? You should not only have used it to verify that the movie worked properly, but also mentioned it in the tutorial.

Work harder, you have the spirit, but the execution lacks.

BlackTurnip responds:

You are of course right, i should have included the simulate download (I think i will include it as soon as i get time, so thank you for the suggestion : ) )

Cool!

I liked the way you could hover over the actionscript to see what it does, I think that makes it easier to learn and remember, so you can use it for other things. Very well laid out and easy to understand!!!!!!!!!!

koool

i like this i very interesting

Cool!

Very useful.

Credits & Info

Views
8,275
Faves:
16
Votes
11
Score
4.28 / 5.00

Uploaded
Apr 24, 2008
1:54 PM EDT