flex获取网页参数

html中,
<html>
<body>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
                                                    width="692" height="78" align="right">
                                                    <param name="movie" value="test.swf?serverURL=myserver&port=9898" />
                                                    <param name="quality" value="high" />     
                                                    <embed src="test.swf" width="692" height="78" align="right" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"
                                                        type="application/x-shockwave-flash"></embed>
                                                </object>
</body>
</html>

在Application上就可以这样取
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()" >
<mx:Script>
private function init():void
{
trace (this.parameters.serverURL+":"+this.parameters.port);
}

</mx:Script>

你可能感兴趣的:(Flex)