1 Reply Latest reply on Jul 1, 2010 9:50 AM by Flex harUI

    Moving a Sprite

    Warentester Level 1

      Hello everyone,


      it would be great if you could help me out with this.


      I would like to move the Sprite i created whenever I push a Button.


      I wrote some code but it didn't work.


      Thanks a lot in advance!


      Here is the code.



      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                        xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:local="*">
           <local:KeyboardMove /> 


           import flash.display.Graphics;
           import flash.display.Sprite;
           import flash.events.KeyboardEvent;
           import mx.core.UIComponent;
           public class KeyboardMove extends UIComponent
                public var quad:Sprite;
                public function KeyboardMove() 
                     quad = new Sprite();
                     quad.focusRect = true;
                public function myMove(e:KeyboardEvent):void
                     quad.x += 20;