Post-Event Screen Updates : MouseEvent : Development Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Development » MouseEvent »

 

Post-Event Screen Updates


 

package{
    import flash.display.GradientType;
    import flash.display.Sprite;
    import flash.geom.*;
    import flash.events.*;
    import flash.ui.*;
    public class Main extends Sprite {
    
         public function Main() {
            var triangle:Sprite = new Sprite(  );
            triangle.graphics.lineStyle(1);
            triangle.graphics.beginFill(0x00FF001);
            triangle.graphics.moveTo(250);
            triangle.graphics.lineTo(5025);
            triangle.graphics.lineTo(025);
            triangle.graphics.lineTo(250);
            triangle.graphics.endFill(  );
            triangle.x = 200;
            triangle.y = 100;
            
            triangle.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveListener);
            
         }
        private function mouseMoveListener (e:MouseEvent):void {
          var pointInParent:Point = parent.globalToLocal(new Point(e.stageX,e.stageY));
          x = pointInParent.x;
          y = pointInParent.y;
        
          e.updateAfterEvent(  );
        
          if (!visible) {
            visible = true;
          }
        }
    }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Development
» MouseEvent