• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Flash professional + action script to check existing file

New Here ,
Jun 16, 2012 Jun 16, 2012

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.

TOPICS
ActionScript

Views

973

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 16, 2012 Jun 16, 2012

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 16, 2012 Jun 16, 2012

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 17, 2012 Jun 17, 2012

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

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 17, 2012 Jun 17, 2012

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 17, 2012 Jun 17, 2012

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 17, 2012 Jun 17, 2012

Copy link to clipboard

Copied

LATEST

Hello Kglad:

I copy exactly the one above.

output is :

ioError

file not found

please help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines