Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Community Beginner ,
Dec 29, 2018 Dec 29, 2018

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? 

449
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 30, 2018 Dec 30, 2018
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 30, 2018 Dec 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 30, 2018 Dec 30, 2018

any code in the loaded swf is the issue.

comment-out line 2 in your code and retry.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 30, 2018 Dec 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 30, 2018 Dec 30, 2018

you’re conflating loading a swf with loading an xml.  i showed how to load a swf which is what you asked for.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 30, 2018 Dec 30, 2018
LATEST

not what I meant.  I could load a normal swf.  It gets an error,'I think', because the file I am trying to load is loading xml data  locally through the file class.  Air for security reasons doesn't like this.  I am trying to find a work around so I can have add ons to the program I am making that can save and load to the same place as the original air file

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines