的问题郁闷好几天了,解决了,本以为与as3下的用法相同,错了~!
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
applicationComplete="initApp()">
<mx:Label text=
"Will run the app deployed at http://{serverURL}:{port}/MyGreatApp.html" />
<mx:Script>
<![CDATA[
[Bindable]
public var serverURL:String;
[Bindable]
public var port:String;
function initApp():void{
serverURL=Application.application.parameters.serverURL;
port=Application.application.parameters.port
}
]]>
</mx:Script>
</mx:Application>
外部以test.swf?serverURL=String&port=String 的形式在网页中调用,也可以用flashvars参数传值!
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
applicationComplete="initApp()">
<mx:Label text=
"Will run the app deployed at http://{serverURL}:{port}/MyGreatApp.html" />
<mx:Script>
<![CDATA[
[Bindable]
public var serverURL:String;
[Bindable]
public var port:String;
function initApp():void{
serverURL=Application.application.parameters.serverURL;
port=Application.application.parameters.port
}
]]>
</mx:Script>
</mx:Application>
外部以test.swf?serverURL=String&port=String 的形式在网页中调用,也可以用flashvars参数传值!