and the action script solution is also pretty easy. It’s important to note (as you are new) that actionscript can be placed in either a frame, OR attached to an object.
Take the object that you want to move select it.
make sure that it’s a movie clip. If you don’t know, check the properties panel. It should tell you there. If it isn’t one, hit F8 with it selected, then choose movieclip from the dialogue that pops open. Name it whatever you like and hit ‘ok’.
Now that it’s a MC or movie clip, select it, and open the actions panel. The panel should say “object actions” at the top. If it doesn’t you don’t have the object selected.
when you see that, paste this code
onClipEvent(load){
//change this to where you want the clip to stop
endLocation=400;
}
onClipEvent(enterFrame){
diff=endLocation-_x;
//change the 4 to a higher number to slow, lower number to speed up the effect
_x+=diff/4;
}
The first part of the code says “when this loads, create a variable called ‘endLovation’ and set it equal to 400.” you can change the 400 to whatever end x location you want.
The second part says "each time this movie clip’s play head enters a frame, do the following: create a variable called diff and set it equal to the difference between endLocation and the current x location of this object, then set the x location of this object to whatever x currently is, plus the diff variable divided by 4;
so if our object is at x location 0, and this script is on it. The math goes like so
it loads on 0, endLocation is 400
diff equals 400 - 0, or 400.
diff is divided by 4 resulting in 100
object is moved along the x axis 100 pixels to the right of it’s current location.
next time around the loop
x location is 100
diff equals 300 (400 - 100)
diff is divided by 4 resulting in 75
object is moved along the x axis 75 pixels to the right of it’s current location
next time around
x location is 175.
diff equals 225
and so on and so on.
for reference… cause it always confused me.
_x by itself is the x location property of the object that the code is attached to. You can set the x by placing it on the left side of an equals sign, or you can read the x property by placing it on the right side of an equals sign.
+=, -=, and *= are shorthand. x+=10 is the same thing as saying x=x+10.