Nathan Campos
Nathan Campos

Reputation: 29497

Move Symbol in The Direction of a Point

I have a Bullet symbol on my stage, but I want to move it towards a Point at a given speed. Is there any way of doing this?

Upvotes: 1

Views: 82

Answers (1)

net.uk.sweet
net.uk.sweet

Reputation: 12431

You don't specify which version of ActionScript you're using but, if it's ActionScript 2.0, you can move a symbol as long as it is a MovieClip type and you give it an instance name. In ActionScript 3.0 I think you can also move a Button symbol,

The easiest way to move the symbol to a new point would be to use a tween library such as Greensock's TweenLite which is pretty much the standard for movement in Flash. If you're using ActionScript 3.0, you could use the built in Tween class. Either of these will allow you to move the object over a duration which you can specify in either seconds or frames.

Upvotes: 2

Related Questions