Local Global Sample : Stage : Development Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Development » Stage »

 

Local Global Sample


 
package
{
    import flash.display.Sprite;
    import flash.events.MouseEvent;
    public class Main extends Sprite
    {
        public function Main()
        {

            this.stage.scaleMode = "noScale";
            this.stage.align = "tl";

            var localSprite:Sprite = new Sprite();
            localSprite.graphics.beginFill(0x00ffCC1);
            localSprite.graphics.drawCircle(0050);

            localSprite.graphics.endFill();

            addChild(localSprite);
            localSprite.x = 200;
            localSprite.y = 200;

            localSprite.addEventListener(MouseEvent.MOUSE_MOVE, moving);
        }

        private function moving(mouseEvent:MouseEvent):void
        {
            trace(' local ' + mouseEvent.localX + ' ' + mouseEvent.localY);
            trace(' stage ' + mouseEvent.stageX + ' ' + mouseEvent.stageY);
        }
    }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Development
» Stage