2 Replies Latest reply: Apr 10, 2013 7:43 PM by doodlemancer RSS

    Flash CS6/JSFL: Relative fileURI's

    maki99 Community Member

      Hi,

       

      Back in Flash CS5 and earlier I could use relative paths in fileURI's passed to fl.OpenDocument(). E.g fl.openDocument( 'file:///myfile.fla' ); would locate myfile.fla in the same folder that the current script resides.

       

      However, when I do this in Flash CS6 I get an error saying "Cannot find file myfile.fla". Using absolute paths works, but that doens't solve the problem...

       

      Any clues, anyone?

        • 1. Re: Flash CS6/JSFL: Relative fileURI's
          burakk

          Hi,

           

          It seems broken starting with CS5.5.

           

          (I'm on Windows).

           

          The problem seems resulting from current directory (folder) not being set when you open a script or FLA. So, relative paths still work but they are always relative to the root of C drive (in our tests) which of course defeats its purpose.

           

          Best,

          Burak KALAYCI

          @asvguy

          • 2. Re: Flash CS6/JSFL: Relative fileURI's
            doodlemancer

            You can use the URI class from XJSFL to convert your relative path to an absolute path but you have to download the XJSFL framework and initialise it in your JSFL file in order for it to work. You can download and find out more their website www.xjsfl.com

             

            p.s. apparently javascript errors won't show up in CS5 and earlier when you use XJSFL which is a major bummer