emma welles


tween objects overlapping
January 9, 2007, 9:43 pm
Filed under: actionscript, flash

i have been having a lot of issues with my tween object animations. things jumping around weirdly in cases where animations overlapped. today, the amazing Felix came to my rescue yet again and took a quick look at my code. he suggested a more efficient solution to what i had, which was creating a new tween object for movement on rollover and then another new one on rollout. that, mixed with an attempt at using ColorFX to tween the color was getting super buggy.

// create tween object, tell it to go no where
var bTweenX:Tween = new Tween(button, "_x",
    Back.easeOut, xStart, xStart, 1);

//create color object
var bColor:ColorFX = new ColorFX(button.buttonText);

//button actions
button.onRollOver = function(){
	bTweenX.continueTo(xEnd,tweenLength);
	bColor.tint(232,184,105,100);
}
button.onRollOut = function(){
	bTweenX.continueTo(xStart,tweenLength);
	bColor.tint(188,93,20,100);
}

No Comments Yet so far
Leave a comment



Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>