An iOS app resides within its own directory and has access to common sub-directories that are contained within it.
This recipe will show you how to reference each of these directories.
We will use chapter13\recipe3\recipe.fla
from the book's accompanying code bundle as a starting point. Open it into Flash Professional.
A dynamic text field named output
can be found on the stage. We will use this text field to display the native file path of each of the app's common directories.
Perform the following steps:
Create a new document class and name it
Main
.Import the
File
class:import flash.display.MovieClip; import flash.filesystem.File;
Within the constructor, write each directory's native path to the
output
text field:public function Main(){ output.text ="Application Directory:\n" +File.applicationDirectory.nativePath + "\n\nApplication Storage Directory:\n" +File.applicationStorageDirectory.nativePath +"\n\nDocuments Directory...