flash on 2011-5-9

by demouth
ペンタブではTouchEventは発生しない。
♥0 | Line 19 | Modified 2011-05-09 22:22:22 | MIT License
play

ActionScript3 source code

/**
 * Copyright demouth ( http://wonderfl.net/user/demouth )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/mBCf
 */

package {
    import flash.text.TextField;
    import flash.display.Sprite;
    import flash.events.MouseEvent;
    import flash.events.TouchEvent;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            
            var t:TextField = new TextField();
            t.width = this.stage.stageWidth;
            this.addChild(t);
            this.stage.addEventListener(MouseEvent.MOUSE_DOWN , function(e:MouseEvent):void {
                t.text = e.toString();
            });
            this.stage.addEventListener(TouchEvent.TOUCH_BEGIN , function(e:TouchEvent):void {
                t.text = e.toString();
            });

        }
    }
}