FullScreenが使えるようになってたのね。

by umhr
♥0 | Line 57 | Modified 2009-05-04 12:46:15 | MIT License
play

ActionScript3 source code

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

package {
	import flash.display.Sprite;
	import flash.external.ExternalInterface;
	import flash.events.Event;
	import flash.events.MouseEvent;
	public class Main extends Sprite{
		private var shikaku:Sprite = MakeUI.newSprite([stage.stageWidth/2,stage.stageHeight/2], null, [["beginFill", [0x0000FF, 0.5]], ["drawRect", [-100, -100, 200, 200]]]);
		public function Main():void {
			addEventListener(Event.ENTER_FRAME,function(e:Event):void{shikaku.rotation ++});
			addEventListener(MouseEvent.CLICK,onClick);
			shikaku.buttonMode = true;
			addChild(shikaku);
		}
		private function onClick(e:MouseEvent = null):void{
			if(stage.displayState == "normal"){
				stage.displayState = "fullScreen";
			}else{
				stage.displayState = "normal";
			}
		}
	}
}

import flash.display.DisplayObject;
import flash.display.Sprite;
class MakeUI {
	public static function newSprite(x_y_w_h_sp:Array = null,property:Array=null,graphics:Array=null,addChild:DisplayObject = null):Sprite{
		var i:int;
		var sp:Sprite;
		if(x_y_w_h_sp && x_y_w_h_sp[4]){
			sp = x_y_w_h_sp[4];
		}else{
			sp = new Sprite();
		}
		if(x_y_w_h_sp){
			if (x_y_w_h_sp[0]) { sp.x = x_y_w_h_sp[0] };
			if (x_y_w_h_sp[1]) { sp.y = x_y_w_h_sp[1] };
		}
		if(property){
			for (i = 0; i < property.length; i++) {
				if(property[i] && property[i].length > 1){sp[property[i][0]] = property[i][1] };
			}
		}
		if(graphics){
			for (i = 0; i < graphics.length; i++) {
				if(graphics[i] && graphics[i].length > 1){
					sp.graphics[graphics[i][0]].apply(graphics[i][2], graphics[i][1]);
				}
			}
		}
		if(addChild){ sp.addChild(addChild) };
		if(x_y_w_h_sp){
			if (x_y_w_h_sp[2]) { sp.width = x_y_w_h_sp[2] };
			if (x_y_w_h_sp[3]) { sp.height = x_y_w_h_sp[3] };
		}
		return sp;
	}
}