开发者

Use airSWF.installApplication() after a URLLoader's callback

I'm trying to use a variation of the Flash Badge to install an AIR application. Here's what needs to happen:

  1. User clicks "download"
  2. Send a request using URLRequest/URLLoader to my web service to retrieve some information
  3. Pass that information into the AIR app using the install/launch arguments

The problem I'm having is getting the airSWF to do anything after URLLoader is done. Since airSWF.installApplication() must be called within the handler of a user-generated event, it doesn't do anything when it's inside the URLLoader Complete event, and the fact that the original event was user gener开发者_如何学Cated doesn't seem to pass through the chain of events.

Is there anything I can do so that the above flow will work?


I've solved this by requesting the necessary data from the server (step 2) right away at the application start.

Not that elegant, since there is no guarantee that the user will click on the download button, and i store the just-in-case data anyway, but it works.

So when the user decides to click on the download button, I check air status, and if it's installed on the machine, i just use the already stored values, and download-->install or launch the application.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜