Movement Preloader?

I am trying to make a preloader where rather than have a bar which gets bigger, I want a movieClip to move across the stage. I am using the following code but it doesn’t work:

stop;
PercentLoaded = getBytesLoaded/getBytesTotal100;
if (PercentLoaded != 100) {
setProperty(boat, _x, PercentLoaded
12);
} else {
gotoAndPlay(“3”);
}

Can anyone help me?

It isn’t in a seperate scene or movieclip, might this be the problem?

Thanks, Ben

if your movie clip is as big as 1200 (weight) then i don’t see the problem! Else, replace the *12 with the *3+100 or something…Helped you?
Or…
you could replace the:

setProperty(boat, _x, PercentLoaded*12);

with the:

_root.boat._x=PercentLoaded*3;

or the:

_root.boat._x=PercentLoaded*12;

It must work now!!
Try all this…

It isn’t the *12 because I can take that out all together and it makes no difference.

Also, should it be whithin a movieclip because at the moment it isn’t, it’s just on frames 1 and 2 of the timeline (frame 2 being goToAndPlay(1):wink:

I’ll have another look at it

Thanks

[edit]

I found this code on one of the tutorials here, which works but I don’t really see the difference Does anyone know?

bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
_root.boat._x = getPercent1200;
_root.box = Math.round(getPercent
100)+“%”;
if (bytes_loaded == bytes_total) {
_root.gotoAndStop(3);
}

Also, now it works, but it only shows the first frame of my mc. Does anyone know how to make it play as it moves across?

Make only one frame, not 2 and add this to the main frame! the movieclip that will move is named ‘mc’ (without the quotas). It worked for me!!

stop();
nik=mc._x;
_root.onEnterFrame= function() {
	bytes_loaded = Math.round(_root.getBytesLoaded());
	bytes_total = Math.round(_root.getBytesTotal());
	getPercent = bytes_loaded/bytes_total*100;
	mc._x=nik+getPercent*2; //instead of *2 you can add *12 or whatever you want
	if (bytes_loaded == bytes_total) {
		//do when movie is loaded
	}
}

Your code was missing the “_root.onEnterFrame= function() {”