主题:  "dswmedia folder"有什么用途?

wws2000

职务:普通成员
等级:1
金币:1.0
发贴:126
#12000/12/4 21:53:05
"dswmedia folder"有什么用途?
看d8的E文帮助,说得不是太清楚,哪位高手给介绍一下它的实际用途?用了它之后有什么好处?



ruifeng

职务:普通成员
等级:1
金币:0.0
发贴:58
#22000/12/5 10:40:17
是给在Shockwave应用环境下放置Director movie所需的外部文件,一般用来放Extranal cast和Linked media,如avi,mov等等。



wws2000

职务:普通成员
等级:1
金币:1.0
发贴:126
#32000/12/5 19:56:23
去macromedia.com搜索了一番,找到些东西,看个似懂非懂, 贴出来请大家看看,究竟是怎么回事?
我比较关心二点:一是它怎么用,二是用了之后有什么好处。

Activating safemode

In any Director environment, including the Shockwave player, a projector, the authoring environment, a movie in a window, and so on, you can activate safe mode with the following Lingo command:


set safePlayer = true

You cannot exit safe mode in any of the playback environments. Once in safe mode, the movie and any movies opened in a window or loaded later are subject to the safe mode restrictions.

When a movie is played in safe mode, it is restricted in the following ways:

The movie cannot read or write files on the user's local disk, except to get or set a movie's preferences. There is, however, one exception. A movie can read files that are stored in a folder named dswmedia (or a subfolder at any depth), which is a subfolder of the folder containing the Shockwave player. Dswmedia is also called the support folder. See Using dswmedia folders and the support folder later in this document.
Lingo that reads from or writes to a local disk does not function. (See the sections that follow for a list of Lingo restrictions.)
The movie cannot obtain or broadcast any data about the local system, including local files, pathnames to local files and disks, local IP addresses, and so on. It can obtain system configuration information such as the type of operating system, and the number of colors the monitor is set to display.
The movie cannot install binary code on the client machine unless Director has authenticated the data and the user approves of the source.
The Shockwave player warns the user when the movie is about to do something which might be a security risk, such as accessing information from a server outside the domain from which the movie is playing, or switching into or out of a secure protocol.


Note that when you play a movie in a browser with the Shockwave player, it is in always safe mode, even if the movie is on your local system. This is true even when you use File > Preview in Browser to run a movie that is currently open in the authoring environment. This means that linked media that appears in the authoring environment may not appear when you preview in a browser. See the next section for instructions on solving this problem.


Using dswmedia folders and the support folder

Use a dswmedia folder to obtain data from a local source while a movie is playing in safe mode. Director treats folders named dswmedia as exceptions to the safe mode feature that normally stops movies from reading data from any local source. Any linked media or cast files in a dswmedia folder, or a subfolder of any depth, may be read by a movie running in safe mode. You can use relative links or full file paths to files in dswmedia folders.

To test movies in a browser locally before uploading them to your Web server, place the movie, linked casts, and linked media in a directory tree within a dswmedia folder and use relative links. When you move the movie and its media to a Web server for testing, keep the directory structure intact. You must use file and folder names which do not have spaces or capital letters, and which have recognized file extensions like .dcr and .gif, in order for them to be accessible from your server.

To access local media while a movie is playing in safe mode, install the media in a dswmedia folder in a known location on the user's computer. This location can be a CD that you provide.

There is a dswmedia folder with special properties in the Shockwave player folder (in the same location as the Xtras folder). This folder is called the support folder. If you, or a user, pre-install media in the support folder, you can import or refer to the media in Lingo with URL like this:


file://FILENAME

Director interprets this path as a URL to the support folder. You can only enter this path in Lingo, not in dialog boxes that accept URLs.

You can only use the file://FILENAME syntax to reference files in the support folder. You cannot use this syntax to refer to subfolders. (file://folder/filename.ext).



ruifeng

职务:普通成员
等级:1
金币:0.0
发贴:58
#42000/12/6 8:52:53
怎么用:
你的Director movie位置:http://www.domin.com/dirfile/mymovie.dcr
你的dswmedia folder位置:http//www.domin.com/dirfile/dswmedia/mycast.cct或http://www.domin.com/dirfile/dswmedia/mymov.mov
好处:
Shockwave环境下Extranal cast和Linked media只能放在dswmedia目录下



机器猫 5D精英

职务:普通成员
等级:3
金币:10.5
发贴:1197
#52000/12/6 12:39:34
我正好作过这个事情。如果你的shockwave文件调用了一些外部的Cast的话在本机调试会报告找不到东西
只要把这个写外部的相关文件放在 dswmedia 目录下面在本机调试的时候就可以找到了



Call Me Simon

职务:普通成员
等级:2
金币:2.0
发贴:646
#62000/12/6 12:55:25
这个功能只是在run safe mode 而且是在local 状态下测试有用, 如果published online, 你可以把外部文件或cast 文件放在任何地方, 只要director movie里的连接是正确有效的就可以了。



wws2000

职务:普通成员
等级:1
金币:1.0
发贴:126
#72000/12/8 7:34:29
多谢以上诸位的热心解答!
我在本机的pws环境下已经试过了,链接的cast库和媒体(avi、mov、pic、wav等)只有放在dswmedia目录下才可以找到。
我还有问题:

1、如此,几个movie共享一个cast库或同一个媒体时,是不是该共享的东西对浏览者来说只下载一次就行了。

2、“downLoadNetThing”在什么时机用,怎么用?
用"gotonetmovie"命令前或调用大的东西前(如avi、wav等)是不是要先“downLoadNetThing”,并在得到netdone后再继续。

3、flyingbird版主说得“local 状态下”和“published online”有点不太懂,是不是说在本机调试用到"dswmedia",而真正网上发布后并不一定需要"dswmedia"。

编辑历史:[这消息被wws2000编辑过(编辑时间2000-12-08 07:40:24)]
[这消息被wws2000编辑过(编辑时间2000-12-08 07:43:48)]


机器猫 5D精英

职务:普通成员
等级:3
金币:10.5
发贴:1197
#82000/12/8 7:54:01
是这样的,上网了就不要了

我有一个疑问为什么我在网上发布的时候里面的play都不起作用只有goto netmovie有用处?
其他人都和我说 play是可以用的:(



ruifeng

职务:普通成员
等级:1
金币:0.0
发贴:58
#92000/12/8 10:24:07
用go to或 play之前,必须要用preloadNetThing把需要的movie download下来!



ruifeng

职务:普通成员
等级:1
金币:0.0
发贴:58
#102000/12/8 10:37:08
wws2000在上个贴子中说
引用:
多谢以上诸位的热心解答!
我在本机的pws环境下已经试过了,链接的cast库和媒体(avi、mov、pic、wav等)只有放在dswmedia目录下才可以找到。
我还有问题:

1、如此,几个movie共享一个cast库或同一个媒体时,是不是该共享的东西对浏览者来说只下载一次就行了。

2、“downLoadNetThing”在什么时机用,怎么用?
用"gotonetmovie"命令前或调用大的东西前(如avi、wav等)是不是要先“downLoadNetThing”,并在得到netdone后再继续。

3、flyingbird版主说得“local 状态下”和“published online”有点不太懂,是不是说在本机调试用到"dswmedia",而真正网上发布后并不一定需要"dswmedia"。



1. 是
2. “downLoadNetThing”在Authoring mode和project mode下使用,Shockwave mode不能使用
怎么用:netID = downloadNetThing(yourURL, yourLocalFile)
3. 否。“local 状态下”指safe mode的测试。published online或叫做Shockwave mode也可以使用castlib(yourcastlib).filename = yourURL指示Extranal cast的连接位置。



wws2000

职务:普通成员
等级:1
金币:1.0
发贴:126
#112000/12/8 19:00:55
我基本上明白了。

网上movie跳转一般用"getnetmovie",该命令在新movie处于调用阶段时一直在当前movie继续播放所以当前movie在执行跳转时,最好有个友好提示,如"正在调入数据请稍等"等类似的话。

如果一定要用play或go to ,则要先preloadNetThing一下。

以上认识不知对否?

另外我还有一个问题:dr中当一个movie存在多个库(不管是内库,还是外库)时,有没有当前库的概念?需要不需要切换,调用castmember时应注意什么问题?
以前都是用单库,现在需要用到多库,一时有些搞不太清楚。哪位高手给讲一下。