all groups > flash (macromedia) > december 2003 >
You're in the

flash (macromedia)

group:

not the usual preloader



not the usual preloader thecrawf
12/9/2003 9:48:08 PM
flash (macromedia): First let me say when it comes to Action Script I am a bit of a Noob so
please be gentle!
I am using Flash MX by the way.

I've searched the web for preloader tutorials and can find hundreds on
percentage or progress bar, but the preloader that I need to make is a bit
different and I would appreciate any help or tutorials.

My preloader is in the style of Pacman. Therefore I have an MC of pacman
(with mouth opening and closing)/ a row of dots (left to right) and a finish
dot.
All I have to do is get the Pacman MC to move from left to right to indicate
progress. The problem is, I don't know how to move him using getBytesLoaded.

Thanks for any help

andy

Re: not the usual preloader thecrawf
12/9/2003 10:32:26 PM
thanks, I'll give it a go



[quoted text, click to view]

Re: not the usual preloader Andre Hessler
12/9/2003 11:30:36 PM
use getBytesLoaded to controll the _x value of the pacman-MC

example:
you have a movie clip, called "preload_mc".
put the row of dots and the pacman into this mocieclip in two seperate
layers. Place Pacman on the left site of your row of dots an give him the
instancename pacman_mc.

your preload-funktion makes the folowing call:
tmp = (_root.getBytesLoaded()/_root.getBytesTotal())*<width_of_dotsrow>
_root.preload_mc.pacman_mc._x = tmp;

thats it!



[quoted text, click to view]

Re: not the usual preloader thecrawf
12/9/2003 11:48:13 PM
Hmm

I tried the following.
I created the MC as you said.
put this on frame1 layer 1
frame 1 layer 2 = stop();

Made a blank MC and positioned it off-screen and attached the following
script

onClipEvent (enterFrame) {
tmp = (_root.getBytesLoaded()/_root.getBytesTotal())*283
_root.preload_mc.pacman_mc._x = tmp;

_root.nextFrame();
}

This doesnt work. Any ideas?

I said I was an ActionScript Noob!

andy

[quoted text, click to view]

Re: not the usual preloader urami_
12/10/2003 6:35:04 AM

[quoted text, click to view]

There could be few ways to approach it .
I would make pacman as movie clip and motion tween on the length of 100 frames.
Than use getBytesLoade against getBytesTotal and based on result progress the movie clip.
The movie clip could be with mask to covert while tweening some of the dots .
http://www.flashfugitive.com/fd/loader.html

Regards

urami_*



<lsym>

There's no place like 127.0.0.1

Re: not the usual preloader Andre Hessler
12/10/2003 12:13:19 PM
No! For the preload action you have to use at least two _root-frames (or the
like)

put pacman_mc to _root layer1 frame1, goto frame 2 and press F5!
now put those actions into _root layer2:
frame 1
*nothing*

frame 2
tmp = (...)*283;
_root.preload_mc.pacman_mc._x = tmp;
if (tmp <= 283) gotoAndPlay(1);

istead of _root, you can also take a blanc MC positioned off-screen but...
:-(

A hint: work with two scenes.
scene 1: The preload scene as written above. In frame 3 you can write
gotoAndPlay("szene2", 1);
scene 2: Your main movie.

-André-




[quoted text, click to view]

Re: not the usual preloader Andre Hessler
12/10/2003 12:18:19 PM
sorrysorrysorry

put preload_mc to _root layer1 frame1...

[quoted text, click to view]

AddThis Social Bookmark Button