Skip navigation
mandychol99
Currently Being Moderated

Flash professional + action script to check existing file

Jun 16, 2012 10:13 PM

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.

 
Replies
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 16, 2012 10:22 PM   in reply to mandychol99

    you're creating an air application and want to check if a file with a known path/file name exists?

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 17, 2012 6:35 AM   in reply to mandychol99

    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

    }

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 17, 2012 10:32 PM   in reply to mandychol99

    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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points