Please help me with flash mx 2004 script.?

Nasrin

New member
i have a movie clip with the instance name of ASHKAN.i want this movie clip to move to right each second.i mean each second my movie clip goes to right.what should i write in script box???
 
It depends on the framerate of your movie (I believe you can change that in document properties or something like that. By default, it's 12 frames per second)

So, on the main timeline, you want to put the following code:
if(ASHKAN.frameCount==undefined){
ASHKAN.frameCount=0
}//this will keep track of the time
onEnterFrame=function(){
ASHKAN.frameCount++
if(ASHKAN.frameCount==12){
//change the number 12 to your framerate, if it's not the default framerate
ASHKAN._x+=1 //this will move it to the right by one pixel. If you want it to move more, change the 1 to a higher number. If you want it to move left, change += to -=
ASHKAN.frameCount=0
}
}

And that's it. Make sure you copy and paste the whole chunk in there, the comments will automatically be taken out of the code loop.
 
Back
Top