Question : AS3 tween multiple arrows along a path

Hi Guys,

I need to use AS3 to tween multiple arrows along a custom path that is drawn in AS3 (as a movie clip?)

I currently use tweenmax but cant seem to find a solution that allows me to do this.

Many thanks

S

Answer : AS3 tween multiple arrows along a path

What you could do is put all the arrows in a movieclip and then use a 'for' loop to control all the arrows.
I am going to use TweenMax for this: http://www.greensock.com/tweenmax/

Import com.greensock.*
import com.greensock.easing.*

var len:int= mcHoldingYourArrows.numChildren
for (var i:int=0; i<len; i++) {
var mc:MovieClip=MovieClip(mcHoldingYourArrows.getChildAt(i))
//mc is a new name and does not have correspond to existing movieclips, but has to be used always //when reffering to the MC that hold your arrows.
TweenMax.to(mc, 2, {x: yourNewXpositionAsAnumber, ease:Back.easeOut})
mc.addEventListener(Event.ENTER_FRAME, ent)
}

function ent(e:MouseEvent) {
var mc:MovieClip=MovieClip(e.target)
}
Random Solutions  
 
programming4us programming4us