As3: Simple Preloader, Step By Step
- Cjross313
-
Cjross313
- Member since: Nov. 21, 2007
- Offline.
-
- Forum Stats
- Member
- Level 07
- Blank Slate
There is one problem I should point out, that is you added a space on this line:
var pcent:Number=event.bytesLoaded/event.byt esTot al*100;
It should be:
var pcent:Number=event.bytesLoaded/event.byt esTotal*100;
I wish I was this inventive with code, but I'm a stupid noob. -.-
Insanity is a true sign of genious...
- Meinos
-
Meinos
- Member since: May. 10, 2005
- Offline.
-
- Forum Stats
- Member
- Level 04
- Blank Slate
You're the man. Very very useful topic, tutorial, and files. Thank you.
- robbe
-
robbe
- Member since: Mar. 22, 2008
- Offline.
-
- Forum Stats
- Member
- Level 25
- Game Developer
Finally, I was looking all over for a simple tutorial.
This is the first good one I found. All the other tutorials were like with external AS files and stuff.
Thank you very much.
- MarkP0rter
-
MarkP0rter
- Member since: Nov. 25, 2006
- Offline.
-
- Forum Stats
- Member
- Level 19
- Blank Slate
for some reason the play button wont work/ i cant press it but flash doesnt give me an error
- tonzie
-
tonzie
- Member since: Mar. 16, 2008
- Offline.
-
- Forum Stats
- Member
- Level 08
- Blank Slate
Uh.. My load bar only starts to show after it reaches about 98%
I have it in the first frame in the first scene, the rest of the flash is in the second scene. I'm not new to flash, but this has got me stumped. Any suggestions?
- Onitz
-
Onitz
- Member since: Apr. 26, 2006
- Offline.
-
- Forum Stats
- Member
- Level 03
- Blank Slate
Very helpful, thank you :D
- Denvish
-
Denvish
- Member since: Apr. 25, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (15,977)
- Block
-
- Forum Stats
- Member
- Level 46
- Blank Slate
At 10/28/07 09:58 PM, Armegalo wrote:At 10/22/07 02:43 PM, WarpZone wrote:
Whenever I try this, the whole screen is white, no matter what, until it finishes downloading. The text box does not appear until the Download Simulation is 100% complete. I can't get trace events to fire, either.
Is that something to do with when you "export for actionscript" it automatically ticks the box "export in 1st frame". You then need to untick that box on everything that you export.
I'm sure there's an easier method but then I would normally place all the symbols I was exporting in the 1st frame into an object in the 2ndframe and make sure that the user doesn't see it!
While this is bumped, might as well answer the question. Generally, if you don't see the preloader (in either AS2 or 3) until the movie's nearly finished loading, it probably means that you've got a large music file and have got it set for 'Export for Actionscript' and 'Export In First Frame' set in the Library>Right Click>Linkage for the wav/mp3 file.
Keep the 'Export for Actionscript' checked, but untick the 'Export in First Frame'. Instead, start your whole movie/game on frame 3, create a new MC (I call it SFX), and add every sound to a seperate frame within that MC. Then chuck that MC from the library to Frame 2, main timeline of your fla. This basically forces it to become part of the preload, rather than trying to pre-empt it, but still means your sounds will be accessible to attach throughout the movie/game, via their linkage.
- OxideAlloy
-
OxideAlloy
- Member since: Jun. 29, 2009
- Offline.
-
- Forum Stats
- Member
- Level 01
- Blank Slate
- eddyg
-
eddyg
- Member since: Mar. 7, 2005
- Offline.
-
- Forum Stats
- Member
- Level 12
- Blank Slate
Wow, this helped a lot, thank you
- rjoseph
-
rjoseph
- Member since: Aug. 19, 2010
- Offline.
-
- Forum Stats
- Member
- Level 01
- Blank Slate
I've installed the As3 Simple Preloader and it works fine on the mac in firefox and safari, but on the pc it works only once in both Firefox and Explorer 7, and when you go back to the page with the movie it only shows the bar and does not start the movie again.
Any ideas and help would be great.
Thanks,
Rob
- kaiser-d
-
kaiser-d
- Member since: Sep. 17, 2005
- Offline.
-
- Forum Stats
- Member
- Level 13
- Blank Slate
This did not work for me. I followed your instructions exactly and it does not seem to recognize the code. The code is placed in the right place, however it returns the following error:
Scene 1, Layer 'preloader', Frame 1, Line 9 1086: Syntax error: expecting semicolon before al.
I am using flash cs5.
- kaiser-d
-
kaiser-d
- Member since: Sep. 17, 2005
- Offline.
-
- Forum Stats
- Member
- Level 13
- Blank Slate
At 4/23/08 08:42 PM, Cjross313 wrote: There is one problem I should point out, that is you added a space on this line:
var pcent:Number=event.bytesLoaded/event.byt esTot al*100;
Nevermind, this was my problem.



