True that! My bad! I tested out, and realized the [params] won't change!
Actually what i meant is that during an enter_frame event, or OnUpdate,
we are calling our function for example 30 times/ sec..so if we have something in this
function, that's running down also 30 times..
Im thinking something like a CuePoint, but in the TweenMax!
anyway in the end i came up with this:
public function lifeHandler()
{
trace(timeTween.currentTime + " current time")
if (timeTween.currentTime > 5)
{
timeTween.currentTime -= 5;
}else
{
timeTween.currentTime = 0;
}
}
public function lifeStarter()
{
timeTween = new TweenMax(_tl.life_line, lifeSec, { x:Math.round(-300), ease:Linear.easeNone, onUpdate:ChangePatch});
}
private function ChangePatch()
{
_x = Math.floor(_tl.life_line.x);
if (_x >= -87 && _x <=0)
{
if (boychar == false)
{
//change Hero Path for boychar
//call the function once
}
boychar = true;
menchar = false;
oldchar = false;
}
if (_x <= -88 && _x >= -197)
{
if (menchar == false)
{
//change Hero Path for menchar
//call the function once
}
menchar = true;
boychar = false;
oldchar = false;
}
if (_x <= -198 && _x >=-300)
{
if (oldchar == false)
{
//change Hero Path for oldchar
//call the function once
}
menchar = false;
boychar = false;
oldchar = true;
}
}