A lot of path queries floating around at the moment so let's see if we can
do a quick wrap up of what we can do...
All external files are referenced by an absolute path, such as
X:\Media\MyFile.mov. However you will encounter problems if you hard code
the whole thing into your script.
However you can get the first bits from two commands: the applicationPath
and the moviePath. Both of these will return the full location of your
projector file. You can then use this as a base for the rest of your path
info.
Example
You got a folder on your CD called "video" which contains the digital video
you are using in your project. The projector is running at the root of this
CD. The directory structure looks like this...
root
-- projector.exe
-- video
-- fish.mov
-- greetings.mov
Using the moviePath or the applicationPath will return "X:\". You now have
the drive letter and the full path to your movie. If you now tack on to the
end of that "video\fish.mov" you have a full path to your movie.
videoPath = the moviePath & "video\fish.mov"
Your projector will now know where to look.
Things to Note:
1./ When running from a projector, the applicationPath and the moviePath
will return the same thing. During authoring, however, they return different
things. The applicationPath will return the full path of the Director
program itself, whereas the moviePath will return the path of the .dir
project file. It will also return nothing until the project has been saved
for the first time.
2./ Windows and MacOS use different characters to chop up path elements,
called delimiters. The PC uses the backslash ("\") and Macs use the colon
(":"). You will need to take this into account when you create
cross-platform projects. You can write a simple script to sort this out...
on GetPathDelimiter
if the platform contains "mac" then
pathDelim = ":"
else
pathDelim = "\"
end if
end
You can then write paths like
myPath = the moviePath & "videos" & pathDelim & "intro" & pathDelim &
"welcome.mov"
This will return something like "X:\videos\intro\welcome.mov" on the PC or
"cd:videos:intro:welcome.mov" on the Mac
Hope this helps everybody who needs it.
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]