Copy link to clipboard
Copied
I’m trying to load a swf that’s on a remote server.
Common sense, and some Adobe documentation, says that it should be done in the same way as loading from a swf stored locally:
var request:URLRequest = new URLRequest("http://www.[yourdomain].com/externalSwf.swf");
var loader:Loader = new Loader();
loader.load(request);
addChild(loader);
I’m testing this with an AIR v22 project running straight from FlashCS5.5. No problem with local loads.
I guess uncommon sense is needed because this results in: Error #2036: Load Never Completed. Same problem when trying to load an image this way, although I guess that URLLoader and a ByteArray might take care of that. But I really need to load swfs. When I listen for loader.contentLoaderInfo.bytesTotal I get just a fraction of the real total.
I’m guessing that somehow this may involve application domains or security domains but I’ve no idea how to use them. I’ve seen many questions about about this asked here but haven’t found a working solution.
How DO you load a swf from a server into an Adobe AIR project?
Hi Umanoff,
I tried with a sample project at my end using the same code that you shared and AIR_24.0.180 on iOS 10.0.1.
But when I hit the URL (http://umanoff.com/SWFTEST.swf ) it gives me 404 Not Found error, So I tried with a sample swf hosting it on my local server and it gets loaded successfully once I specify exceptions to the default behavior.
Thanks,
Adobe AIR Team
Copy link to clipboard
Copied
Hi Umanoff,
Kindly go through the below link and Please specify exceptions to the default behavior by adding keys to InfoAdditions tag of the application descriptor of your app.
URLRequest - Adobe ActionScript® 3 (AS3 ) API Reference
Please let us know if you still face any problem.
Thanks,
Adobe AIR Team
Copy link to clipboard
Copied
First, thanks for looking into this for me. My test with the new InfoAdditions were not successful, neither on the desktop (Windows7) nor iOS (10.0.2).
My entire code for this test follows:
and this is what the InfoAdditions part of my app.xml looks like:
<InfoAdditions>
<![CDATA[
<key>UIDeviceFamily</key>
<array><string>2</string></array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>www.umanoff.com</key>
<dict>
<!--Include to allow subdomains-->
<key>NSIncludesSubdomains</key>
<true/>
<!--Include to allow HTTP requests-->
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<!--Include to specify minimum TLS version-->
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>
]]>
</InfoAdditions>
Also: here's my traced output from the PROGRESS and IOERROR listeners.
[SWF] basic%20remote%20swf%20loader.swf - 3654 bytes after decompression
progress: 0
progress: 233
progress: 281
progress: 233
IOError here: 2036
Copy link to clipboard
Copied
Hi Umanoff,
I tried with a sample project at my end using the same code that you shared and AIR_24.0.180 on iOS 10.0.1.
But when I hit the URL (http://umanoff.com/SWFTEST.swf ) it gives me 404 Not Found error, So I tried with a sample swf hosting it on my local server and it gets loaded successfully once I specify exceptions to the default behavior.
Thanks,
Adobe AIR Team
Copy link to clipboard
Copied