How could I do:
To attach a movieclip (e.g. \'footsteps\'), along a path (other movieclip).
That would be within a interval for attaching one movieclip at a
You have to have your path as a mathematical function of t like (x,y) = f(t)
. In this case it's just a matter of moving a new movieclip to (x,y)
and rotating it using for example Math.atan2
.
In your case it's not clear what along a path (other movieclip)
means. For example, is it static or dynamic?
The hackish way of doing this if you got a static path is using an empty sprite which is tweened along this path for 100 frames for example. In this way the function (x,y) = f(t)
will be
mc.gotoAndStop(int((t-minTime)/(maxTime-minTime)));
var xToAddFootsteps:Number = mc.dummy.x;
var yToAddFootsteps:Number = mc.dummy.y;
var rotationOfFootsteps:Number = Math.atan2(xToAddFootsteps, yToAddFootsteps);
Provided that the path movieclip is called mc
and the empty sprite inside is called dummy
.