📄 flexshowcaseservice.mxml
字号:
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas
xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="handleCreationComplete(event)"
>
<mx:Script>
<![CDATA[
//////////////////////////////////////////////////
//import
import flash.events.Event;
import flash.events.IOErrorEvent;
//////////////////////////////////////////////////
//getter/setter variables
private var _serviceConfig:FlexShowcaseServiceConfig;
//////////////////////////////////////////////////
//public variables
[Bindable] public var configURL:String;
//////////////////////////////////////////////////
//initialization
private function handleCreationComplete(event:Event):void {
if (configURL != null) {
var urlRequest:URLRequest = new URLRequest(configURL);
flexShowcaseServiceConfig = new FlexShowcaseServiceConfig();
flexShowcaseServiceConfig.load(urlRequest);
}
}
//////////////////////////////////////////////////
//getter/setter functions
[Bindable]
public function get flexShowcaseServiceConfig():FlexShowcaseServiceConfig{
return _serviceConfig;
}
public function set flexShowcaseServiceConfig(flexShowcaseServiceConfig:FlexShowcaseServiceConfig):void {
_serviceConfig = flexShowcaseServiceConfig;
if (_serviceConfig.requiresload) {
_serviceConfig.addEventListener(Event.COMPLETE, handleServiceConfigLoaded);
_serviceConfig.addEventListener(IOErrorEvent.IO_ERROR, handleServiceConfigFailed);
} else {
dispatchServiceReady();
}
}
//////////////////////////////////////////////////
//dispatch functions
private function dispatchServiceReady():void{
var event:Event = new Event(Event.COMPLETE);
dispatchEvent(event);
}
private function dispatchServiceFailed():void{
var event:Event = new IOErrorEvent(IOErrorEvent.IO_ERROR);
dispatchEvent(event);
}
//////////////////////////////////////////////////
//handle functions
private function handleServiceConfigLoaded(event:Event):void {
dispatchServiceReady();
}
private function handleServiceConfigFailed(event:Event):void {
dispatchServiceFailed();
}
]]>
</mx:Script>
</mx:Canvas>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -