0 Replies Latest reply on Apr 11, 2008 10:08 AM by Vimpact

    getRelativePath returning null

    Vimpact Level 1
      I'm trying to load an SWF into an Adobe AIR app. When I try to get the relative path to the SWF from the application directory it returns null. What am I missing here?

      var appDir:File = File.applicationDirectory;
      var swfFile:File=new File();
      function selectSWFFile(e:Event):void {
      swfFile.browseForOpen("Open", [txtFilter]);
      swfFile.addEventListener(Event.SELECT, loadSWF);
      function loadSWF(e:Event):void {
      trace(appDir.getRelativePath(swfFile));// returning null