As near as I can tell, the relevant lines where the Security.allowDomain("*") 
gets inserted into the MainTimeline are in /lib/as3/script.c, starting on line 
89:



    __ getlex(c, "[package]flash.system::Security");
    __ pushstring(c, "*");
    __ callpropvoid(c, "[package]::allowDomain", 1);


Unless somebody advises me otherwise, I will try commenting out these lines and 
recompiling.  I will do a test tomorrow to determine if this fixes the problem.


I will have to do this on my Fedora server where I have succeeded in getting 
swftools to compile.  The process for compiling on Windows looks to be way 
beyond me.


  _____  

From: Andrew Sinning [mailto:[email protected]]
To: [email protected]
Sent: Sun, 06 May 2012 15:05:24 -0500
Subject: [Swftools-common] pdf2swf and AIR

      

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/[email protected]/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  
---------------
SWFTools-common is a self-managed list. To subscribe/unsubscribe, or amend an 
existing subscription, please kindly point your favourite web browser 
at:<http://lists.nongnu.org/mailman/listinfo/swftools-common>

Reply via email to