这是我逼疯......根据我的研究,我应该能够直接传递查询字符串参数到SWF对象,像这样:如何将查询字符串值传递给swf?
http://localhost:3000/SomeFlash/bin-debug/myFlash.swf?userId=827419
在MXML oncreationcomplete方法我已经试过如下:
// oncreationcomplete method
var userIdTest1:String = FlexGlobals.topLevelApplication.parameters[0];
var userIdTest2:String = Application.application.parameters.userId;
var userIdTest3:String = this.parameters.userId;
// External Interface
ExternalInterface.addCallback("OnGameLoad", ClientParams);
// callback method
protected function ClientParams(userId:String):void
{
this.userId = userId;
}
源 http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf626ae-7feb.html
我使用Flashbuilder 4.5使用Flex 4.5.1编译器。我用一个html包装器使用mxml,但我试图通过url将参数直接传递给swf。
好主意,有一个托管的HTML页面始终是通常一个更好的主意。我想不出为什么要直接在浏览器中调用SWF,而不是为了快速分发给朋友,以便他们可以试用您的项目。 – bigp
swf用于直接使用swfs的3d应用程序,所以我不能有一个html包装器 – chobo