トップ 差分 一覧 ping ソース 検索 ヘルプ PDF RSS ログイン

ActionScript アニメーション



目次



記事一覧

キーワード

ActionScript アニメーション

[ActionScript]

 API

event.enterFrame

Event.ENTER_FRAME

 

package  
{
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.TextEvent;
    import flash.text.TextField;

    public class SimpleEnterFrame extends Sprite
    {
        private var txt:TextField;
        public function SimpleEnterFrame() 
        {
            if (stage) init();
            else addEventListener(Event.ADDED_TO_STAGE, init);
        }

        private function init(e:Event = null):void 
        {
            txt = new TextField();
            txt.text = "Enter Frame";
            txt.autoSize = "left";
            addChild(txt);
            
            addEventListener(Event.ENTER_FRAME, enterFrameHandler);
        }
        private function enterFrameHandler(e:Event):void {
            trace(e);
            txt.y += 3;
            txt.x += 4;
        }
    }
}



YAGI Hiroto (piroto@a-net.email.ne.jp)
twitter http://twitter.com/pppiroto

Copyright© 矢木 浩人 All Rights Reserved.