I'm new with Air and I've found following code on the net:
code:
var file = air.File.applicationStorageDirectory.resolvePath(" test.txt");
var str = "Hello.";
file.addEventListener(air.Event.COMPLETE, fileSaved);
file.save(str);
function fileSaved(event)
{
air.trace("Done.");
}
But I get following errors:
I'm using Flash CS4. I also tried publishing but it didn't work. Can anyone help me?Code:1120: Access of undefined property air. air.trace("Done."); 1120: Access of undefined property air. var file = air.File.applicationStorageDirectory.resolvePath("test.txt"); 1120: Access of undefined property air. file.addEventListener(air.Event.COMPLETE, fileSaved);




Reply With Quote
