1 Reply Latest reply on Jan 24, 2011 10:39 PM by Flex harUI

    Error: Type was not found or was not a compile-time constant: FileListEvent

    pelinbali

      I have the following simple application. But during the compilation, I keep getting "Error: Type was not found or was not a compile-time constant: FileListEvent" message. I appreciate your help.

       

      -Pelin

       

      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#ffffff" initialize="init()">
          <mx:Script>

       

              <![CDATA[
                  import flash.events.FileListEvent;
                  import flash.filesystem.File;
         
                 //
                  public function init():void {

       

                      var directory:File = File.documentsDirectory;
                      directory.getDirectoryListingAsync();
                      directory.addEventListener(FileListEvent.DIRECTORY_LISTING, directoryHandler);
                  }
                 

       

                  public function directoryHandler(event:FileListEvent):void {
                      var contents:Array = event.files;
                      for (var i:uint = 0; i < contents.length; i++) {
                          trace(contents[i].name, contents[i].size);
                      }
                  }   

       

                   ]]>
          </mx:Script>
         
      </mx:Application>