all groups > flash actionscript > april 2005 >
You're in the

flash actionscript

group:

making a movie clip loop


Re: making a movie clip loop kglad
4/27/2005 12:00:00 AM
flash actionscript:
onClipEvent (load) {
x = 206;
}
onClipEvent (enterFrame) {
if (x<578) {
this._x += 3; // set "speed" here
} else { // double equal should be used for the comparison operator "if"
this.gotoAndPlay("wire")
this._x=206;
}
}
Re: making a movie clip loop JeffSz
4/27/2005 12:00:00 AM
Re: making a movie clip loop kglad
4/27/2005 12:00:00 AM
Re: making a movie clip loop JeffSz
4/27/2005 12:00:00 AM
works great , heres the code...


onClipEvent (load) {
speedx = 25;
}
onClipEvent (enterFrame) {
this._x += speedx;
if (this._x >=560) {
this._x = 204;
}else if (this._x <= 204) {
speedx = -speedx;
}
}
making a movie clip loop JeffSz
4/27/2005 4:57:12 AM
I know this can't be too hard but I have tried several different methods and I
can't seem to make it work.
Very simply I want to make a movie clip move across the screen to a certian
position and then jump back to the start and do it again, and again. I have no
problem making the clip move from x position 206 to x position 578. The problem
comes when I try to make it go back to 206 and start again. Any help would be
appreciated. The code I tried last is attached. "Wire" is the frame label for
the frame where the movie clip starts.

onClipEvent (load) {
x = 206;
}
onClipEvent (enterFrame) {
for(x=206;x<578;x++)
this._x=x;
if (x<578) {
contiue;
} else if (x=578) {
gotoAndPlay("wire")
}
}
AddThis Social Bookmark Button