Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Slide text smooth with code 2

Status
Not open for further replies.

Firehawk734

Technical User
Jan 22, 2002
155
US
Hey gang,

I need some code to slide from left to right and come to a gradual complete stop..

change in distance divided by length, as the length shortens, the text slows, until it comes to a complete stop.

How do I do this with actionscript?

If old newbie reads this, HI MAN, how are yoU? Remember me? I had to quit web design for 2 yrs due to school and other personal matters, but now im back, and cant remember jack sh*t lol.
 
by the way, I am using Flash MX.

Also, what are some good links to get a bunch of techniques for flash actionscript? Such as progress bars, etc.

 
Hi! Welcome back!

I like a lot... Should help you get back into shape!


Regards,

cubalibre2.gif
 
I dont see an example of sliding text in there Newbie. Wont be the first time I cant see something right in front of my face ;)

I want the text to slide and gradually come to a stop, nice and smooth :)
 
If this here:


is smooth enough for you, all I did was add this code:

onClipEvent (load) {
_root.targX = 400;
_root.targY = 80;
}
onClipEvent (enterFrame) {
cX = this._x;
cY = this._y;
difX = cX-_root.targX;
difY = cY-_root.targY;
setProperty(this, _x, cX-(difX/5));
setProperty(this, _y, cY-(difY/5));
}


to a movie clip that had the text in it. It comes to a gradual stop, which is what I think you were looking for?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top