Flex getApplicationVersion() always returns null version

匿名 (未验证) 提交于 2019-12-03 09:58:14

问题:

I'm currently working on a Flash application that has a sibling AIR equivalent. From inside the Flash application I would like to install the sibling AIR App. Adobe has provided an air.swf (which is also used in the Badge sample) to aid us with the install. I've managed to mimic the behavior of the Badge app but getApplicationVersion always returns null. Note that I do not have a publisherId.

Here's the documentation provided by Adobe: Installing and running an AIR applications from a web page

Air application XML:

...  < id >MyAirApplication< /id >  ...

Now I'm trying to find out the application version using the following:

 public function DoAction(event:MouseEvent):void  {    try {       m_airSwf.getApplicationVersion( "MyAirApplication", "", CheckVersion_);    }    catch(e:Error) { ... } }  private function CheckVersion_(version : String):void {    Alert.show("Version: " + version); // Always returns null }    

Now the CheckVersion_ function is called and the version that is passed in is always null. I've checked the log and I've found this entry:

[2011-02-08:09:29:14] Commandline is: -playerVersion=10,1,53,64 -sandboxType=remote -securityDomain=airdownload.adobe.com -https=false -fromUserEvent=true -- -launch MyAirApplication

I'm clearly missing something here. My actions seem pretty straight forward and I can't seem to pin point why it's not finding my application. Does anyone have any idea? Oh I've also tested on Windows 7 64bit, and Windows XP (to test permissions).

回答1:

I've found out my issue. It wasn't quite clear but in order to launch OR query the AIR application you require the following in your application.xml

<allowBrowserInvocation>true</allowBrowserInvocation>


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!