Return to Snippet

Revision: 27885
at June 25, 2010 21:25 by LeeProbert


Updated Code
/*

  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>

Revision: 27884
at June 25, 2010 21:09 by LeeProbert


Initial Code
/*

  Some code used in a project for scaling and moving an object around. Properties of the tweens are bound        to properties of the class.
*/

<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>

Initial URL

                                

Initial Description
Here's some example of how to apply Spark easing classes using MXML

Initial Title
Spark Animation and Easing classes usage

Initial Tags

                                

Initial Language
MXML