1 person found this helpful
var _Filename = "includes/myHTML.txt";
var _theFile = air.File.applicationDirectory.resolvePath(_Filename);
var _theStream = new air.FileStream();
var _theContents = _theStream.readUTFBytes(_theStream.bytesAvailable);
In place of applicationDirectory, you also have these options:
applicationStorageDirectory—a storage directory unique to each installed AIR application
applicationDirectory—the read-only directory where the application is installed (along with any installed assets)
desktopDirectory—the user's desktop directory
documentsDirectory—the user's documents directory
userDirectory—the user directory
Thanks for the reply but my problem is some what different.
My directory structure is like:
As you have suggested in the code "applicationDirectory" which returns the path of bin-debug.I need to read the config.xml which is present in config folder for which i need to give the relative path from the program which present in src folder. I have tried with /../config/config.xml to move a level up in the directory structure but it did'nt worked. It is throwing the error "Error #3003: File or directory does not exist"
I haven't tried this at all, but where does
I don't know if you can customize where it points to or not.
I suppose the only other solution I can think of is to move your config directory under the bin-debug directory.
I am a very long way from being an expert at AIR, so there be other options I am not aware of.
Hope that helps!
I have also tried with application storage directory, but this is actually a unique storage path for every AIR application. This takes me to a
"C:\Documents and Settings\user\Application Data\testProject\Local Store" which is unique space.
Anyways thanks for the help.