📄 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 + -