i created an animaton in flash mx of a speedometer going from 0-100, i want it to become a preloader , so that KM/H represents the % complete…but i have trouble with the actionscripting part…can any one help me please…? i’d be really grateful!
Yeah! I’d love to see this too!!
First you have to make your pointer bar thingamagig its own movie clip with the registration point at the far end that goes in the center of the speedometer.
Depending on the space for rotation…
Frame 1…
bytes_loaded = Math.round(_root.getBytesLoaded()/1000);
bytes_total = Math.round(_root.getBytesTotal()/1000);
_root.pointerBar._rotation = bytes_loaded/bytes_total*100;
if (bytes_loaded == bytes_total) {
gotoAndPlay("Scene 2", 1);
delete bytes_loaded;
delete bytes_total;
}
Frame 2
gotoAndPlay(1);
Something along those lines, this is untested of course. As for the gotoAndPlay at Scene 2, I always put my preloader in the scene before my movie, I find it easier for me to edit my movie without having to go over the preloader. I am a strange one, you can change what it loads to whatever
Or you could do this…I use this preloader quite often…
I designate the first two frames of my _root time line to the preloader.
Frame 1:
(ActionScript)
var percent = Math.Ceil((_root.getBytesLoaded() / _root.getBytesTotal()) * 100 );
progressbar.gotoAndStop(percent);
Frame 2:
(ActionScript)
if (percent < 100 ) {
_root.gotoAndPlay(1);
}else{
_root.gotoAndPlay(3);
}
Of course you’ll have your “progressbar” Movie Clip that tweens from frame 1 to 100.
Hope this helps out.
:cyclops: