I'm having trouble with accessing the AIRAliases file from a local page loaded in an iFrame. Here is how my files are organized in my app:/ folder:
So index.html has an iFrame wich loads "html/video1.html". This page has the following code:
var file = "video1.flv" //flv file to be played
var flvFile = air.File.applicationDirectory.resolvePath("flv/"+file);
flvFile = flvFile.nativePath; //gets the absolute path to the flv file
Now, if I preview the index file, I get no alert and the Introspector gives me the following error: "TypeError: Undefined value"
Thanks for any help!
What certainly could be your culprit is if you're loading video1.html and then attempting to hit library resources from video1.html
You will not be able to do that by default unless you use a sandbox script bridge.
Jeff has posted a good quickstart on that here:
You should also look at the AIR help cross-scripting content in different security sandboxes here:
I hope that helps!
Thank you Saka!
I was kind of expecting that I would end up having to learn more about this sandbox feature...
After reading quickly through Jeff's tutorial, I think what I'll need to do is the "Script communication between diferent sandboxes" right?
To be able to do this, do I need to configure the iFrame as a sandbox? If yes, will it look like that: