Be a Supporter!

As3: Simple Preloader, Step By Step

  • 54,247 Views
  • 41 Replies
New Topic Respond to this Topic
Cjross313
Cjross313
  • Member since: Nov. 21, 2007
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to As3: Simple Preloader, Step By Step 2008-04-23 20:42:06 Reply

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
Response to As3: Simple Preloader, Step By Step 2008-10-04 06:21:14 Reply

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
Response to As3: Simple Preloader, Step By Step 2008-11-01 07:09:11 Reply

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.


BBS Signature
MarkP0rter
MarkP0rter
  • Member since: Nov. 25, 2006
  • Offline.
Forum Stats
Member
Level 19
Blank Slate
Response to As3: Simple Preloader, Step By Step 2008-11-22 22:34:26 Reply

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
Response to As3: Simple Preloader, Step By Step 2008-12-08 20:45:52 Reply

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
Response to As3: Simple Preloader, Step By Step 2009-03-25 20:59:28 Reply

Very helpful, thank you :D

Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to As3: Simple Preloader, Step By Step 2009-03-25 21:11:50 Reply

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.


- - Flash - Music - Images - -

BBS Signature
OxideAlloy
OxideAlloy
  • Member since: Jun. 29, 2009
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to As3: Simple Preloader, Step By Step 2009-10-05 21:24:32 Reply

Hells yeah.

eddyg
eddyg
  • Member since: Mar. 7, 2005
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Response to As3: Simple Preloader, Step By Step 2010-03-30 11:03:44 Reply

Wow, this helped a lot, thank you

rjoseph
rjoseph
  • Member since: Aug. 19, 2010
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to As3: Simple Preloader, Step By Step 2010-08-19 13:33:39 Reply

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
Response to As3: Simple Preloader, Step By Step 2011-03-22 18:47:53 Reply

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.


FB | Blog
If you ever wondered who to blame for your problems, find a mirror.

BBS Signature
kaiser-d
kaiser-d
  • Member since: Sep. 17, 2005
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to As3: Simple Preloader, Step By Step 2011-03-22 18:55:27 Reply

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.


FB | Blog
If you ever wondered who to blame for your problems, find a mirror.

BBS Signature