Feb 22
For those planning to load a Flex module into your AIR application from a remote server: take a look at this post before beating your head against the wall with this ambiguous error message Error: Unable to load style(SWF is not a loadable module).
Basically, loaded SWF’s are not allowed to be in the same security domain as your AIR app. Since modules and external styles loaded using StyleManager.loadStyleDeclaration() try to load themselves into the current security domain, an error will be thrown. The only workaround it appears is to bundle those modules with your application when it’s downloaded. Any new modules you want to add to you app at a later time can be downloaded using AIR’s update API via Updater.update().
February 27th, 2008 at 7:07 am
Hi,
Have you also considered downloading the swf as a binary from the air app and then access it locally via SWFLoader? I am currently doing some research on this for one of our customers. It seems to work (at the first sight).
Have a nice day!
Tim
February 28th, 2008 at 12:03 am
Haven’t tried that yet. But I think I’m going to take the Updater approach. I figure since it’s an AIR up, the user shouldn’t have to download anything unless there’s an update.
April 15th, 2008 at 2:53 pm
Thanks for the post. I ran into this exact issue today, and Tim’s comment was the tip I needed to make it work. Note that modules have an internal Loader process, so in order to make this work, you need to copy the ModuleLoader class to your application and change the Loader to a URLStream/LoadBytes instead. Its a bit convoluted, but it does work.
April 15th, 2008 at 2:53 pm
Sorry, mx.modules.ModuleManager class.