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

File write works if testing in Flash but not if SWF is launched directly

Contributor ,
Jan 09, 2011 Jan 09, 2011

Copy link to clipboard

Copied

Hi,

I'm new to Air so forgive me if this is something rudimentery.  I wrote an air application in Flash, that writes to an XML file.  When testing it within flash (with in the Air debugger) everything works perfectly, but if the swf or exe is launched outside of flash the write functionality no longer functions.   Pleas ehlp me if you can.

Best regards,

Chris McLaughlin

TOPICS
Performance issues

Views

3.0K

Translate

Translate

Report

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
New Here ,
Jan 10, 2011 Jan 10, 2011

Copy link to clipboard

Copied

I'm having a very similar problem. Any calls I make to the air file api return this error:

VerifyError: Error #1014: Class flash.filesystem::File could not be found.

My app functions perfectly when I test in air debug, otherwise nothing works... ...

Please Help!!!

Votes

Translate

Translate

Report

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
Contributor ,
Jan 10, 2011 Jan 10, 2011

Copy link to clipboard

Copied

Hi,

Did you publish the file? I ask because that's what solved my problem and uh . . . cause everybody has the right to be uniformed, I didn't realize that publishing in the Air sense is very different than publishing a flash file. It involves creating an installer. If you knew that already don't laugh. If not then maybe that's the first step.

The other thing that I've read with respect to newer operating systems is that writing to certain directories is blocked and the recommendation is that you use the application storage directory.

This bit will tell you where that is but I still couldn't get past it because uh . . . well you know

import flash.filesystem.File;

var f:File = File.applicationStorageDirectory.resolvePath("presentations.xml");

path_ti.text = f.nativePath;

Good luck!

Votes

Translate

Translate

Report

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
Adobe Employee ,
Jan 11, 2011 Jan 11, 2011

Copy link to clipboard

Copied

Hi,

If Chris's suggestions don't work please feel free to post some code so we can take a more indepth look.

Thanks,

Chris

Votes

Translate

Translate

Report

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
Contributor ,
Jan 11, 2011 Jan 11, 2011

Copy link to clipboard

Copied

Hey Chris

Ah the bleeding edge . . .

What does this tell you:

Error #2044: Unhandled skinError:. text=Error #2047: Security sandbox violation: parent: file:///C:/Program Files/ElancoICP/Full/C106.swf cannot access app:/ElancoICP_THIS_ONE.swf.

Votes

Translate

Translate

Report

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
Contributor ,
Jan 11, 2011 Jan 11, 2011

Copy link to clipboard

Copied

Hey Chris,

Never mind . . . I will read up on this . . . Someday.

For my fellow coders, my issue seemed to stem from the fact that I was providing an absolute path to a child SWF which was playing the video.

I switched to relative path to the SWF and the original configs for the FLV and skin which were absolute and problem appears to be solved.

I guess this next bit of info also makes sandbox sense but JPGs accessed via an absolute path gave no error so I wasn't looking to hard a the code were the paths loading the children were defined.

Votes

Translate

Translate

Report

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
Adobe Employee ,
Jan 11, 2011 Jan 11, 2011

Copy link to clipboard

Copied

LATEST

Hi Chris,

I'm the first to admit that I'm not fully versed in AIR sandbox security, but here's a couple of things to consider.

If you embed the swf it will be loaded with the proper privledges.  You might also be able to load with an app:/ URI, or via loadBytes() + allowLoadBytesCodeExecution.

Here are a couple of docs that might interest you when you have some free time

Working securely with untrusted content

Security Sandboxes

Chris

Votes

Translate

Translate

Report

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