CR的代码文本

all for learning about the world
  订阅 订阅  :: 管理

Lingo07 – 使用cast脚本库

Posted on 2011-10-28 15:16  mumuliang  阅读(322)  评论(0编辑  收藏  举报

Dean's: http://www.deansdirectortutorials.com/scripting/tut14.htm

     

关于Cast的一点儿拎得清

Cast是一个清单。cast member才是其中的项,譬如text, script, palette.

直观一点,cast是cast window中的tab,tab内的东西才是cast member,才是可拖进stage的个体。

这点儿跟现实中的一场movie只有一个cast是不一样的。

创建CST

打开Cast window,快捷键Ctrl+3;

cast标签下方有个cast的功能键,打开选择new cast;

在弹出的new cast窗中填写cast名称,Storage设置为external,确保Use in Current Movie选中,Create;

选中新建的这个cast,然后打开script window,快捷键Ctrl+0零;

这时,会在新的cast中出现一个script类型的member。

随便在script window中写几句代码,譬如 go to the frame,将脚本属性设置为behavior,然后Ctrl+S保存script,会弹出提示保存Cast文件的对话框;

在想要的地方取个想要的名称,一个.cst就这样生成了。

使用CST

在其他Director工程中,使用File->Open(Ctrl+O),打开cst文件;

新的cast会出现在新的cast window中,此时的窗体看起来有点没激活的意思;你无论怎么合并也没办法把它合并到原先的cast window中;

往score上拖script member,会提示。。。自己看;

选Link… 。

这时候新的cast 就合并到当前movie的cast window中了。

移除外部的cast

打开Movie Casts window,快捷键 Ctrl + Shift + C;

略。

     

注:往Score中拖脚本不动的时候,检查是不是忘记修改script为behavior了。