/ Published in: MXML
Here's some example of how to apply Spark easing classes using MXML
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* Some code used in a project for scaling and moving an object around. Properties of the tweens are bound to properties of the class. USAGE : In your actionscript you just need to refer to the class id like so shirtMoveToNoScale.play(); you can also use Actionscript to set listeners, handlers etc. */ <fx:Declarations> <s:Power id="powerEase" /> <s:Move id="shirtMoveToNoScale" target="{this}" duration="500" easer="{powerEase}" xTo="{moveToPointX}" yTo="{moveToPointY}" /> <s:Parallel id="shirtMoveTo" target="{this}" effectEnd="autoZoomMoveEnd(event)" duration="500" > <s:Scale easer="{powerEase}" scaleXTo="{Config.SHIRT_ZOOM_SCALE}" scaleYTo="{Config.SHIRT_ZOOM_SCALE}" /> <s:Move easer="{powerEase}" xTo="{moveToPointX}" yTo="{moveToPointY}" /> </s:Parallel> <s:Parallel id="shirtScaleUp" target="{this}" effectEnd="resetShirtWidthHeight(event)" duration="500" > <s:Scale easer="{powerEase}" scaleXTo="{Config.SHIRT_ZOOM_SCALE}" scaleYTo="{Config.SHIRT_ZOOM_SCALE}" /> <s:Move easer="{powerEase}" xTo="{Config.ZOOM_IN_X}" yTo="{Config.ZOOM_IN_Y}" /> </s:Parallel> <s:Parallel id="shirtScaleDown" target="{this}" effectEnd="resetShirtWidthHeight(event)" duration="500" > <s:Scale target="{this}" easer="{powerEase}" scaleXTo="{Config.SHIRT_START_SCALE}" scaleYTo="{Config.SHIRT_START_SCALE}" /> <s:Move easer="{powerEase}" xTo="{Config.ZOOM_OUT_X}" yTo="{Config.ZOOM_OUT_Y}" / </s:Parallel>