Skip navigation
Currently Being Moderated

Flash CS6/JSFL: Relative fileURI's

Jun 1, 2012 12:39 AM

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?

 
Replies
  • Currently Being Moderated
    Jul 4, 2012 2:28 AM   in reply to maki99

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 10, 2013 7:43 PM   in reply to maki99

    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

     
    |
    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