?? remotecontroller.mxml
字號:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init();" width="300" height="300">
<mx:Script>
<![CDATA[
private var count:int = 0;
private var cmdClient:LocalConnection = null;
private function sendCommand(cmd:String):int{
this.txt_cmds.text = cmd + ' @'+ '\n' + this.txt_cmds.text;
try{
cmdClient.send('player_command','onMessage',cmd);
}catch(ex:ArgumentError){
return -1;
}
//count++;
return 0;
}
private function init():void{
ExternalInterface.addCallback('sendCommand',sendCommand);
this.cmdClient = new LocalConnection();
cmdClient.addEventListener(StatusEvent.STATUS,this._onStatusEvent);
}
private function _onStatusEvent(evt:StatusEvent):void{
this.txt_cmds.text = 'StatusEvent:'+evt.level + ' @'+ '\n' + this.txt_cmds.text;
if(evt.level == 'error'){
ExternalInterface.call('_cmdFailed_callback','');
}
}
]]>
</mx:Script>
<mx:TextArea x="10" y="10" width="275" height="109" id="txt_cmds" />
</mx:Application>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -