Copy link to clipboard
Copied
I have Actionscript tween and I am using a variable to control duration of the tween and want tot change that variable during a button function that takes place after the tween, but it doesnt change. Is there a way to change a tween property after its already run?
var tweenDelay=16;
var btnTween:Tween = new Tween(oneBtn_mc, "y", Strong.easeInOut, oneBtn_mc.y, 334.95, tweenDelay, false);
I am runing a button function that plays the tween to animate some buttons on with tween.start(); and then I am using tween.yoyo(); to reverse it when the button is pressed again. But they animate to close to each other so I need to offset it. On the second push I have the variable tweenDelay=10, but when I did a trace(btnTween.duration), and it stays 16.
Copy link to clipboard
Copied
once btnTween executes what difference would it make to change tweenDelay (which is a misnomer - it's really tweenDuration);
any way, use a 3rd party tween class like tweenlite that allows the use of a delay parameter. google: tweenlite as3 greensocks.
Copy link to clipboard
Copied
The name of var doesnt matter I didnt think I just called it tweenDelay because it shorter, and it works. I was wondering if there was a way to change it. Can I use a event listerner like TweenEvent.MOTION_CHANGE or something.
Copy link to clipboard
Copied
yes, you can change it. but again, it won't make any difference once the tween code executes.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now