I'm trying to load a SWF into a simple app for test purposes. The SWF has been compiled using swftools-0.9.1 using the following command:
/usr/bin/pdf2swf 10993.PDF -o 10993.SWF -f -T 9
The SWF loads fine in a browser.
Using the following Flex code together with Flex SDK 4.6:
<?xml version="1.0" encoding="utf-8"?>
private function onCreationComplete():void
swf.SwfFile = 'http://my/domain/10993.SWF';
<flexpaper:FlexPaperViewer width="100%" height="100%" id="swf"/>
The crossdomain.xml file is:
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
The end result is:
SecurityError: Error #3207: Application-sandbox content cannot access this feature.
Any idea why this is happening?
AIR will load the SWF into a sandbox. Crossdomain.xml doesn’t apply to AIR apps because they are running from a desktop, not a domain. If the SWF does not need any same-domain connection to a server when running, you can download the SWF as a bytearray and use loadbytes to view it.
Is this something that's being addressed in AIR 3.7? I found this in the release notes for AIR 3.7 Beta, although it says "iOS". Does this mean it only applies to iOS or will it apply to desktop users too?
External hosting of secondary swf files (iOS)
Application developers will be able to host their secondary SWFs on an External server and load them on demand as per their application
logic using this feature. The loading secondary SWFs which have any ABC code in AOT mode, which worked for just locally packaged
SWFs earlier, will now work for loading SWFs externally as well.
I'm getting the same kind of error as well, but in my case I'm loading the swf file from within the AIR application's directory, not over the web. I kinda think that FlexPaper was never designed to work in Flex desktop or mobile apps, as I have tried to contact their support on this and they basically are non-existent. This is kinda a shame, because on Android this technology would be a good solution for loading pdf documents within the app, without having to open them in an external viewer.
FlexPaper doesn't output anything - the SWF comes from swftools and FlexPaper is available in two versions - Flex 3.5 and Flex 4.6 here: http://code.google.com/p/flexpaper/downloads/list
I haven't tried what you suggested yet Alex but I will do, and then post the code in case anyone else is interested.
The swftools are creating swf files that call:
This why the error. I am not sure if there is a workaround for this, since swftools has no way to turn this off that I am aware of.