Relative paths for external audio and video files?

Jeanne A. E. DeVoto jeanne at runrev.com
Sun Sep 22 13:12:01 EDT 2002


At 12:19 AM -0700 9/22/2002, Robin Banerjee wrote:
>Sorry - I'm new to this so I know I'm probably missing something here.
>But when I create the standalone application (e.g., for windows), I get one
>file -- e.g., test.exe.   If I put media files in the same folder as this
>file, should it work?  And how should I specify the path under 'player
>properties'?

There's some material on this in the docs - look in "About filename and
file paths" - but here is the deal, summarized.

There are two kinds of paths: absolute (which start at a drive or volume
name) and relative (which start at the defaultFolder). You can change the
defaultFolder in a script, but unless you've done so during the current
session, it's the folder the application is in. (If you're still
developing, that's the Rev folder. If you're running a standalone, that's
the standalone's folder.)

For example, if you put a media file in the same folder as the standalone,
its relative path is just the file's name:
  myfile.mov
If you create a subfolder - let's call it "data" - inside the standalone's
folder, in order to be tidy, and then put your media file in that folder,
its relative path becomes:
  data/myfile.mov
You can use relative paths like these in the Properties palette, or in any
Transcript property setting, and they will work the same way as an absolute
path does.

You need to watch out for two things:

1) If any of your scripts change the defaultFolder property, you must be
sure to change it back afterward, or your media files will get lost because
the standalone will be looking for them in the defaultFolder.

2) A standalone looks for the files in its own folder, while a stack looks
for the file's in Revolution's folder because that's the running
application. This means you either need to change your paths when it's time
to build the standalone, or else move the data files around to make sure
they can be found as stack or standalone. (For example, you could store
your "data" folder inside Revolution's folder while developing your stack,
then after building your standalone, move it into the standalone's folder.)

--
Jeanne A. E. DeVoto ~ jeanne at runrev.com
Runtime Revolution Limited - The Solution for Software Development
http://www.runrev.com/





More information about the use-livecode mailing list