Topic: Actionscript masters please help... (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=11303" title="Pages that link to Topic: Actionscript masters please help... (Page 1 of 1)" rel="nofollow" >Topic: Actionscript masters please help... <span class="small">(Page 1 of 1)</span>\

 
RAMshackle
Nervous Wreck (II) Inmate

From: Italy
Insane since: Mar 2002

posted posted 03-26-2002 10:23

I' m just trying to have a movie to work properly, butt I can't get it right. I made a scene with a preloader that includes this piece of code:

loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
loadedkbytes = Math.ceil(loadedbytes/1000);
totalkbytes = Math.ceil(totalbytes/1000);
if (loadedbytes == totalbytes) {
nextScene ();
}
frame = int(loadedbytes/(totalbytes/100));
tellTarget (_root.loader) {
gotoAndStop (_root.frame);
}

The preloader works perfectly, the problem is that, when loaded, the movie jumps to the end of the next scene. I tried to add a stop action to the first frame of the scene but it doesn't work.
Any idea??? Thanx...

Steve
Maniac (V) Inmate

From: Boston, MA, USA
Insane since: Apr 2000

posted posted 03-26-2002 16:49

Wow. That seems to be doing some calculations that aren't necessary. Why do you calculate kbytes and then not use it?

There doesn't seem to be an "else" in the first set of instructions either - what is it supposed to do if loadedbytes != totalbytes?

And one part of the code instructs the movie to go to the next scene, while another part of the code instructs it to go to some frame which is determined as a result of a bizarre calculation!

Anyway, I've outlined a more streamlined preloader at the gurusnetwork: http://www.gurusnetwork.com/tutorials/flash/progress_bar1.html

You might not want to bother with the progress bar, but the calculations might be helpful. I don't use scenes in this, but I suspect you could figure how to get that working.

Hope it helps.

RAMshackle
Nervous Wreck (II) Inmate

From: Italy
Insane since: Mar 2002

posted posted 03-27-2002 15:16

Well, I'm not very good in actionscript, I took the code from a tutorial, can't remember where at the moment. Thanx for the link, now I'll have a look there...



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu