|
Create a file:
simpleDemo.mxml
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundAlpha="0"> <mx:Script> import mx.effects.*; private function moveImage(xTo:int, yTo:int):void </mx:Script> <mx:Panel title="moveEffect Demo [Programmatic Approach]" width="100%" height="100%" <mx:Label text="Click anywhere on the canvas to move the phone to that position"/> <mx:Canvas id="canvas" width="100%" height="100%" mouseDown="moveImage(mouseX - 40, mouseY - 80)"> <mx:Image id="img" source="@Embed('../assets/products/Nokia_6630.png')"/> </mx:Canvas> </mx:Panel> </mx:Application> |