Pass easing function as variable in AS3

Posted by Andrej on Stack Overflow See other posts from Stack Overflow or by Andrej
Published on 2010-05-31T19:53:36Z Indexed on 2010/05/31 20:03 UTC
Read the original article Hit count: 499

Filed under:
|

Hi,

I've been looking for some time now.. Is is possible to pass easing function as variable in AS3?

eg.

TweenLite.to(mcDelimiter, resizeTween, { x:(stageWidthHalf-(initStageWidthHalf-mcDelimiteri_X)), ease:Elastic.easeOut } );  

TweenLite.to(mcBody, resizeTween, { x:(stageWidthHalf-(initStageWidthHalf-mcBody_X)), ease:Elastic.easeOut } );

... now if I at some point want to change "Elastic.easeOut" to something else I would have to change it at multiple parts of the code.. Can it be done so I just pass it as a variable and then if I want to change it, do it only on one place?

EDIT: ...also, can for eg. if(currentFrame == "FrameLabel") somehow be done? ..meaning, can I pass the currentFrame label name as a variable?

Thanks in advance for anwsers,

Andrej

© Stack Overflow or respective owner

Related posts about flash

Related posts about as3