flash.system Details - Flash CS4 Professional ActionScript 3.0 Language Reference Toggle code visibility
Warning: The code example below may contain security vulnerabilities. To learn more about more secure Flash/Flex code, please read the following article.
http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/system/package.html
Note: this example should be executed in the standalone Flash Player and not within a web browser.
package {
import flash.display.Sprite;
import flash.text.TextField;
import flash.system.fscommand;
import flash.events.MouseEvent;
public class FSCommandExample extends Sprite {
private var bgColor:uint = 0xFFCC00;
private var size:uint = 100;
public function FSCommandExample() {
fscommand("fullscreen", "true");
fscommand("allowscale", "false");
draw();
}
private function clickHandler(event:MouseEvent):void {
fscommand("quit");
trace("clickHandler");
}
private function draw():void {
var child:Sprite = new Sprite();
child.graphics.beginFill(bgColor);
child.graphics.drawRect(0, 0, size, size);
child.graphics.endFill();
child.buttonMode = true;
addEventListener(MouseEvent.CLICK, clickHandler);
var label:TextField = new TextField();
label.text = "quit";
label.selectable = false;
label.mouseEnabled = false;
child.addChild(label);
addChild(child);
}
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment