Sequenced Preloader Questions

I am somewhat new to Flash. I used the preloader located here:

http://www.kirupa.com/developer/mx/percentage_loader.htm

I created a small animation on a new layer that loops as the preloader is working. Is there a way to have this animation be in sequence with the Preloader bar?

For example… as the percent loaded equals 33%, the animation would jump to specific point… As the Proloader loaded 66% the animation would jump to a second point. etc.

Did that make sense? Any ideas?

thanks
-ROB

Use this preloader: http://www.kirupa.com/developer/mx/percentagepreloader.htm. Then modify the code like this:

[AS]bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent100;
this.loadText = Math.round(getPercent
100)+"%";
if(getPercent100 <= 33){
Actions for if the preloader less or equal than 33
}
if(getPercent
100 <= 66){
Actions for if the preloader less or equal than 66
}
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}[/AS]

By the way, search the forum, I’ve already answered this question before.

I would use this tutorial for what you are trying to do:
http://www.kirupa.com/developer/mx/percentagepreloader.htm

This way, you are dealing with code instead of a FMX component. This preloader works within the first two frames of the movie that loops until the movie’s loaded. Beacuse of this, your animation would have to be in another movieClip. Once you make that movieClip, give it the instance name of ‘foo’. Then you can make actions like this (for instance) :


if ((getPercent*100)>33){
_root.foo.gotoAndStop("partNumberOne");
}
if ((getPercent*100>66){
_root.foo.gotoAndStop("partNumberTwo");
}
//...etc...etc...

‘partNumberOne’ and ‘partNumberTwo’ would be either the frame names or numbers in foo that you would want to go to.

Hope that helps!

I gotta learn how to type faster!! :stuck_out_tongue:

awesome. I will try that!

I am having trouble still. Here is the code I used for the preloader:

bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
_root.loadBar._width = getPercent200;
_root.loadText = Math.round(getPercent
100)+"%";

if ((getPercent*100)>33) {
_root.foo.gotoAndStop (“PartNumberOne”);
}

if ((getPercent*100)>66) {
_root.foo.gotoAndStop (“PartNumberTwo”);
}

if (bytes_loaded == bytes_total) {
_root.gotoAndStop(3);
}

The animation just loops. The preloader stops working too. What am I doing wrong?

Ok I got the preloader to work now… But my animation is still looping.

Can we see the FLA ?

here is the site:
http://www.furraro.com/test.html

The actual FLA file is at
http://www.furraro.com/Main.fla

“Failed to open document” :-\

Voetsjoeba si there another way I can send you the file. It doesnt seem to be working right on my server…

Does this helps?

Claudio -

That is pretty much what I was looking for. Thanks a lot!!!

But one more thing… Is it possible to have each of those battery levels be animated. Let’s say that they are rotating or changing colors…

Yes, you can use each battery level a movie clip (then animate it)