主题:  Changing linked file paths(转)

Call Me Simon

职务:普通成员
等级:2
金币:2.0
发贴:646
#12001/2/3 17:12:27
这是Macromedia 的一篇Technote.


Question:
How do I avoid the dreaded "Where is..." dialog?

Answer:
Many developers discover the problem of changing drive letters, and file paths after they have pressed their first CD-ROM, only to get the dreaded "Where is..." dialog. This document will show you how to set up your CD-ROM properly, so that you will get it right the first time.

Using the searchPaths and the pathName

Director includes two very important commands regarding file paths. These commands are the searchPaths and the pathName. The searchPaths command tells Director where to look for media files, and the pathName returns the path to the current Director movie. By using these two functions, you can avoid path problems.

Many developers organize their CD-ROM with their projector on the root of the CD-ROM with the content organized in sub-directories. This provides an organized look, and is intuitive to the user, since there are only a few files to click on. This design also makes it fairly easy to tell Director where to find content files.

When Director tries to load a media file it first looks for the path that it was originally linked to, if it does not find it there it will look in the same directory or folder as your movie. If it still cannot find the file, it looks through the directories listed in the searchPaths. The searchPaths is a list that may be appended with many paths. So for example, lets say you have a projector on the root of your CD-ROM with linked Quicktime files located in a sub-directory called QUIKTIME. You also have sound files located in a SOUND directory. You can tell Director to search these directories with the following statement:



on startMovie
append the searchPaths, the moviePath & "quicktime"
append the searchPaths, the moviePath & "sound"
end
Note: As of Director 6, the command "moviePath" replaced the earlier command "pathName".

The append command adds this path to the current searchPaths. The next command on that line is "the pathName" which returns the path to the current movie. Since the projector is on the root of the CD-ROM this command would return "D:\" or whatever the CD-ROM drive letter is. Then we add the directory name to the pathname, so that the final path added to the searchPaths is "D:\QUIKTIME" The next line does the same thing for the sound directory. Now Director will look through these directories for linked media files.

Note: You must put these scripts in a movie that does not load any of the media files from the directories specified in the searchPaths command. A good approach would be to just have your first movie set up the searchpaths in the movie script, then in frame 1, branch to your intro or main movie using the command:



go to movie "main"

编辑历史:[这消息被flyingbird编辑过(编辑时间2001-02-03 17:14:56)]


南山东篱摄螂

职务:普通成员
等级:4
金币:10.0
发贴:1840
#22001/2/4 0:53:26
能帮译一下吗?如果没有时间,能不能译出其中的关建部分,或是用金山快译来,再看看有哪些是译错的改一下也行,因为我很想看到,但是e文太差,而金山快译总是愚我!



Call Me Simon

职务:普通成员
等级:2
金币:2.0
发贴:646
#32001/2/5 12:44:42
东影默在上个贴子中说
引用:
能帮译一下吗?如果没有时间,能不能译出其中的关建部分,或是用金山快译来,再看看有哪些是译错的改一下也行,因为我很想看到,但是e文太差,而金山快译总是愚我!



I found an article written by Agent Mulder, I believe everybody here will be benefited from this file.


页面:点这儿参观



我就是我

职务:版主
等级:6
金币:14.0
发贴:5466
#42001/2/5 16:55:58
原来是莫特写的呀
感觉不错,都是一些常见的问题,还有吗?



donlee

职务:普通成员
等级:1
金币:1.0
发贴:271
#52001/2/6 10:33:59

Multimedia Handyman
Relative filenames for linked members
Sunday Nov 12, 2000
www.director-online.com/accessArticle.cfm?id=926
这篇文章很好!
想不到至今还有人在为文件的链接发愁。

实际上存在大量的linked file情况下,用searchpath是最后的办法,因为在光盘上沿searchpath指示检索文件速度令人担心。我个人比较欣赏@。
如果制作成安装方式典型的情形是projector和xtras放在硬盘,linked files放在光盘,这种情况可选择把movie也放在光盘,只须在stub player中找到光驱盘符就解决问题了。
判定光驱盘符的behavior我曾在macromediachina上贴过(后来发现莫特探员兄早就贴出过类似的东西)。我的感觉是用filextra3更好些。