I'm trying to use a variation of the Flash Badge to install an AIR application. Here's what needs to happen:
- User clicks "download"
- Send a request using URLRequest/URLLoader to my web service to retrieve some information
- 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.
精彩评论