swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swftools-common] pdf2swf and AIR


From: Andrew Sinning
Subject: [Swftools-common] pdf2swf and AIR
Date: Sun, 06 May 2012 15:05:24 -0500

My apologies if this is a duplicate posting.  I have subcribed to the list and have set my preferences to receive my own messages, but after two days this hasn't shown up in my in box, so I will try again:


---- my message -->


For most of today and yesterday I have been trying to solve the problem of bringing a pdf2swf generated swf into an AIR application.  I have read this post, but I don’t believe that it answers the question:

 

      http://www.mail-archive.com/address@hidden/msg03818.html

 

 

The problem is that when the external swf (it doesn’t matter if the swf is on a remote server or is on the local file system) is loaded, there is immediately generated an error:

 

      “SecurityError: Error #3207: Application-sandbox content cannot access this feature.

            at flash.system::Security$/allowDomain()

            at p_fla::MainTimeline/frame1()”

 

 

Luca Agostini, the poster of the thread above, asserts:

 

      “I think the problem is this row in MainTimeline constructor:

            flash.system.Security.allowDomain("*")

      that is not supported in Adobe AIR.”

 

 

I have confirmed this with a test.  I made a simple Flash document with just a shape and single frame.  If I include:

 

      import flash.system.Security;

      Security.allowDomain("*");

 

.. then the error is generated.

 

If I remove those two lines, then the error goes away.

 

 

 

I have read Filip's post carefully, and I have tried to follow his instructions:

 

      "have you set the local-with-network priviledge for your generated swf files?

      do you generate flash9 swfs? the switch is -T9

 

      also, when you're loading those swf you have to make sure you use a

      SecurityContext for your Loader call (AS3):

      yourLoaderObject.load(new URLRequest(url), new LoaderContext(false,

      ApplicationDomain.currentDomain, SecurityDomain.currentDomain));"

 

 

There are a few problems with these instructions:

 

1) Trying to set the securityDomain of the LoaderContext to SecurityDomain.currentDomain will throw up an error "Error:Error #2114: Parameter LoaderContext.securityDomain must be null." 

 

2) It is confusing that Filip is asking "have you set the local-with-network priviledge for your generated swf files?"  It’s not clear to me where this gets set.  The GUI tool Gpdf2swf supports this option, but I don't see a corresponding parameter for the command line tool.  I've tried creating swfs using both options "Access Local Files" and "Access Network Files" in the Flash IDE Publish Settings, but neither options corrects the error.

 

 

 

I really think that Luca got it right when he asked:

 

      MainTimeline constructor:

            flash.system.Security.allowDomain("*")

      that is not supported in Adobe AIR.

 

      It's possible to modify the constructor or delete this feauture?

 

 

I have no idea how to modify the source files, yet alone compile them.  I would really love to try testing a version with the allowDomain command turned off.

 

Thank you so much!

 

--Andrew


reply via email to

[Prev in Thread] Current Thread [Next in Thread]