3 Replies Latest reply on Aug 22, 2007 1:39 PM by deepa subramaniam (adobe)

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

    JoseManimala
      Hey everyone,
      As the title says i get this error each time i compile the code. All the imports are correct but i cant seem to get it to work. you see this is a function in the base class that is declared internal. The function is then called by 5 classes that import it. here is the function code... hope you can help me out here!!

      public function writeToDataFile(file:File,fileName:String,obj:XML):void
      {
      var dataFileStream:FileStream = new FileStream();
      dataFileStream.open(file.resolve(fileName), FileMode.WRITE);
      var header:String=("<?xml version=\"1.0\" ?>\n"+obj.toXMLString());
      header = header.replace(/\r/g, "\n");
      header = header.replace(/\n/g, File.lineEnding);
      dataFileStream.writeUTFBytes(header);
      dataFileStream.close();
      }