My AIR Application runs in the Applications directory (or
where the user installs it).
It is a training programme and different users require
different lesson content, which is stored in their user documents
folder. I have cracked the process of detecting the content,
downloading a zip where it's missing and constructing the folders
required to path it correctly, but I am having difficulty loading
I'm using a standard Loader with URLRequest.
If I place a symbolic link to the user's documents folder
inside the AIR app folder (which was just a test) I am able to load
them using relative pathing.
If I use
appFolder:File = File.applicationDirectory;
I always get null returned as the relative path.
I have also tried resolving the relative path in the opposite
The most bizarre thing is that if I use the absolute path
from the appContentSwf.url property the swf loads but immediately
crashes, giving a TypeError: Error #1034: Type Coercion failed:
cannot convert com.package::MyClass@13ed0d1 to com.package.MyClass
Yes ... it is complaining that it can't convert something to
what it already is.
Is there a 'magic' way of resolving the path from the
application directory to the user documents directory in a way that
can be used by those good old file loaders and URLRequests?
The only alternative solution I have thought of is to subpath
the application directory so that the user lesson content can be
downloaded into there ... ?
This project is very urgent (the client only decided to go
for an AIR based installation system when the main release came out
a couple of weeks ago) and I've been banging my head for hours. All
and any suggestions very gratefully received!