Skip to main content
saratogacoach
Inspiring
March 27, 2019
Answered

Is there a better way to script (AS3) this tween scaling?

  • March 27, 2019
  • 1 reply
  • 386 views

Hi,

In a pure AS3 project, I am using the following as part of a tween to expand and contract a circle evenly:

function tweenChange(e:TweenEvent):void {

   // set scaleY to the same value
   _circle.scaleY = _circle.scaleX
;
}

Should the _circle.scaleY = _circle.scaleX; be written differently to comply with good scripting standards? Is there a better way to script this?

Thank you for your help.

    This topic has been closed for replies.
    Correct answer kglad

    it's okay.  but i don't know why you'd use a tween listener for that when you can use tweens.

    though because you can only tween one property per tween (with adobe's tweens), i prefer greensocks tween classes: you can use one line to tween multiple properties.

    1 reply

    kglad
    Community Expert
    kgladCommunity ExpertCorrect answer
    Community Expert
    March 27, 2019

    it's okay.  but i don't know why you'd use a tween listener for that when you can use tweens.

    though because you can only tween one property per tween (with adobe's tweens), i prefer greensocks tween classes: you can use one line to tween multiple properties.

    saratogacoach
    Inspiring
    March 27, 2019

    Thank you.

    Just want to try to use good AS3 syntax.

    kglad
    Community Expert
    Community Expert
    March 27, 2019

    you're welcome.