13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Working with the file system<br />

Platform Directory type Typical file system location<br />

Windows Application C:\Program Files\fil<strong>en</strong>ame<br />

Application-storage C:\Docum<strong>en</strong>ts and<br />

settings\userName\ApplicationData\applicationID\Local Store<br />

Desktop C:\Docum<strong>en</strong>ts and settings\userName\Desktop<br />

Docum<strong>en</strong>ts C:\Docum<strong>en</strong>ts and settings\userName\My Docum<strong>en</strong>ts<br />

Temporary C:\Docum<strong>en</strong>ts and settings\userName\Local<br />

Settings\Temp\randomString.tmp<br />

User C:\Docum<strong>en</strong>ts and settings\userName<br />

The actual native paths for these directories vary based on the operating system and computer configuration. The<br />

paths shown in this table are typical examples. You should always use the appropriate static File class properties to refer<br />

to these directories so that your application works correctly on any platform. In an actual AIR application, the values<br />

for applicationID and fil<strong>en</strong>ame shown in the table are tak<strong>en</strong> from the application descriptor. If you specify a<br />

publisher ID in the application descriptor, th<strong>en</strong> the publisher ID is app<strong>en</strong>ded to the application ID in these paths. The<br />

value for userName is the account name of the installing user.<br />

Directory view for AIR for TV applications<br />

To provide security to the system files on AIR for TV devices, an AIR application can access only a limited set of<br />

directories. AIR for TV prohibits the application from accessing any other directories. Furthermore, AIR for TV<br />

isolates each user’s user-specific data for each AIR application.<br />

The AIR application uses directory names that are only for ActionScript 3.0 use. These names do not repres<strong>en</strong>t actual<br />

directories on the device. AIR for TV maps these ActionScript 3.0 directory names to actual device directories. This mapping<br />

protects AIR for TV applications from maliciously or inadvert<strong>en</strong>tly accessing local files that do not belong to them.<br />

The ActionScript 3.0 directory names are:<br />

/app/ The read-only application directory for the running AIR application.<br />

/app-storage/ The read-write application storage directory for the running AIR application.<br />

/home/ The read-write user directory.<br />

/tmp/ The read-write temporary directory for the running AIR application.<br />

/volumes/ The read-only directory containing zero or more read-write subdirectories that repres<strong>en</strong>t mounted<br />

volumes.<br />

If an application tries to access a prohibited directory, the runtime throws an exception that ActionScript code can<br />

catch.<br />

The following table shows the File.nativePath value for various File properties and methods. The values reflect the<br />

application’s limited view of the device’s file system.<br />

Last updated 6/6/2012<br />

670

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!