Copy link to clipboard
Copied
Hello Guru:
I am using Flash professional with action script 3.
Please recommended me how to check if existing file in drive c: exist or not.
Thanks in advance.
Copy link to clipboard
Copied
you're creating an air application and want to check if a file with a known path/file name exists?
Copy link to clipboard
Copied
I just would like to create flash application and use in my Adobe Capitivate 5.
I just want to check if a file with a known path/file name exists?
Copy link to clipboard
Copied
you could attempt to load that file and use an ieerrorevent to catch its non-existance:
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,errorF);
loader.load(new URLRequest(yourpath/yourfile));
function errorF(e:IOErrorEvent):void{
// catch error
}
Copy link to clipboard
Copied
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,errorF );
loader.load(new URLRequest("c:\CaptivateLog.txt"));
function errorF(e:IOErrorEvent):void{
trace(IOErrorEvent.IO_ERROR);
trace("file not found");
}
// catch error
-------------------------------------------
Hello Kglad:
I have try above but always got to errorF even file is there.
Please help again.
Thanks in advance.
Copy link to clipboard
Copied
use:
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,errorF );
loader.load(new URLRequest("file://c:/CaptivateLog.txt"));
function errorF(e:IOErrorEvent):void{
trace(IOErrorEvent.IO_ERROR);
trace("file not found");
}// catch error
p.s. please mark helpful/correct responses, if there are any.
Copy link to clipboard
Copied
Hello Kglad:
I copy exactly the one above.
output is :
ioError
file not found
please help.