Skip to main content
Known Participant
December 30, 2018
Question

trying to load swf from online to air and I get Security Sandbox Violation ***

  • December 30, 2018
  • 2 replies
  • 504 views

it doesn't like my file stream stuff or ui scrollpane which saves and loads from documents directory.     all I have is the swf online in my public directory.  Do I need  a class folder?  Or maybe these classes are for local only? 

    This topic has been closed for replies.

    2 replies

    Known Participant
    December 30, 2018

    In the beginning of the document you gave me it says

    SWF files that do not contain ActionScript bytecode

    is this bytecode?  that is in the document getting loaded

    fileStream.open(myFile, FileMode.READ);

    var fileText:String = fileStream.readUTF();

    So I tried this it won't load it just better checks it, I guess, doesn't throws as many errors but it loads nothing, if I get rid of line 2 it is the same as it was. loads it but doesn't load it right throws tons of errors. 

    1. var context:LoaderContext = new LoaderContext();

    2. context.securityDomain = SecurityDomain.currentDomain;

    3. context.applicationDomain = ApplicationDomain.currentDomain;

    4. var urlReq:URLRequest = new URLRequest("http://www.[your_domain_here].com/library.swf");

    5. var ldr:Loader = new Loader();

    6. ldr.load(urlReq, context);

    maybe reading a local xml document from online is not doable?   maybe if I use URL request instead of file class?

    kglad
    Community Expert
    Community Expert
    December 30, 2018

    any code in the loaded swf is the issue.

    comment-out line 2 in your code and retry.

    Known Participant
    December 30, 2018

    it doesn't work.  URL request doesn't seem to allow exact path ie("C:\Users\Userid\Documents\XML\addon_xml.xml")   and I wouldn't know the user id anyways. 

    maybe the only way to save  or load other data, if your loading a file from online, is online?  maybe sharedobjects works?  but I have never used it for more then one document.  but it must be called shared for reason?

    kglad
    Community Expert
    Community Expert
    December 30, 2018