当前位置:首页>网络学院>多媒体教程>Director教程>文章内容

AVI播放器制作

[ 来源: | 作者: | 时间:2007-07-22 | 收藏 | 推荐 ] 【

AVI播放器制作

Director 8.5支持多种视频格式,包括常用的MOVAVI视频格式。本节实例将介绍创建AVI播放器,通过控制按钮,可以对AVI进行视频播放、停止、快进、快退等操作。 vd;k;l www.it55.com rdfg

*  AVI播放器制作操作步骤如下: www.it55.com在线教程

(1) 进入Director 8.5。执行ModifyMovieProperties命令,在弹出的舞台属性检查器对话框中将电影舞台的大小设置为500×400,将背景颜色设置为白色,如图7-145所示。

IT资讯之家 www.it55.com

45398 www.it55.com it55学习IT知识,享受IT生活 4dfkjn

7-145  设置舞台的属性 sflj www.it55.com kg^&fgd

(2) Ctrl+R组合键,导入12张图片,在Cast窗口中显示,如图7-146所示。

www.it55.com在线教程

http://www.it55.com/

7-146  导入12张图片 免费资源www.it55.com

(3) Ctrl+R组合键,在Import窗口导入AVI电影,单击OK按钮,在弹出的Select Format对话框中选择AVI格式,如图7-147所示。

sflj www.it55.com kg^&fgd

http://www.it55.com/

7-147  导入AVI电影

vd;k;l www.it55.com rdfg

(4) Cast演员“动画”拖动到舞台上,调整其大小与位置,生成精灵1,效果如图7-148所示。

vd;k;l www.it55.com rdfg

免费资源www.it55.com

7-148  生成精灵1 IT资讯之家 www.it55.com

(5) Cast演员lauluplayustopururau,分别拖动到舞台上,生成精灵234567,调整位置如图7-149所示。

www.it55.com

45398 www.it55.com it55学习IT知识,享受IT生活 4dfkjn

7-149  生成精灵

it55.com

(6) 在工作窗口单击工具栏中的Script按钮,弹出Script窗口,设置脚本类型为Movie,在其中输入以下全局变量,如图7-150所示。 www.it55.com在线教程

on startmovie http://www.it55.com/

  set the movierate of sprite 1 to 0 www.it55.com在线教程

  set the castnum of sprite 2 to member("lad")

www.it55.com

  set the castnum of sprite 3 to member("ld")

45398 www.it55.com it55学习IT知识,享受IT生活 4dfkjn

  set the castnum of sprite 4 to member("playu")

it55.com

  set the castnum of sprite 5 to member("stopd") http://www.it55.com/

  set the castnum of sprite 6 to member("rd") IT资讯之家 www.it55.com

  set the castnum of sprite 7 to member("rad")

it55.com

end IT资讯之家 www.it55.com

45398 www.it55.com it55学习IT知识,享受IT生活 4dfkjn

7-150  Movie脚本

vd;k;l www.it55.com rdfg

(7) 双击Script通道的第2帧单元格,打开Script窗口,输入以下Lingo语句,如图7-151所示。 vd;k;l www.it55.com rdfg

on exitFrame me

IT资讯之家 www.it55.com

  go to the frame

it55.com

end www.it55.com

www.it55.com

7-151  2帧的Lingo脚本 vd;k;l www.it55.com rdfg

(8) 选中舞台上的精灵2,单击右键,在快捷菜单中选择Script命令,打开Script窗口为其添加以下的Lingo语句,如图7-152所示。 www.it55.com

on mouseUp me

IT资讯之家 www.it55.com

  set the movietime of sprite 1 to 0

IT资讯之家 www.it55.com

  set the movierate of sprite 1 to 0

sflj www.it55.com kg^&fgd

  set the castnum of sprite 2 to member("lad")

免费资源www.it55.com

  set the castnum of sprite 3 to member("ld") www.it55.com

  set the castnum of sprite 4 to member("playu")

http://www.it55.com/

  set the castnum of sprite 5 to member("stopd") 45398 www.it55.com it55学习IT知识,享受IT生活 4dfkjn

  set the castnum of sprite 6 to member("ru") www.it55.com在线教程

  set the castnum of sprite 7 to member("rau") vd;k;l www.it55.com rdfg

  updatestage sflj www.it55.com kg^&fgd

end http://www.it55.com/

sflj www.it55.com kg^&fgd

7-152  精灵2Lingo脚本

45398 www.it55.com it55学习IT知识,享受IT生活 4dfkjn

(9) 选中舞台上的精灵3,打开Script窗口为其添加以下的Lingo语句,如图7-153所示。

sflj www.it55.com kg^&fgd

on mouseUp me www.it55.com

    set the castnum of sprite 2 to member("lau") www.it55.com

    set the castnum of sprite 3 to member("ld") www.it55.com在线教程

    set the castnum of sprite 4 to member("playu")

45398 www.it55.com it55学习IT知识,享受IT生活 4dfkjn

    set the castnum of sprite 5 to member("stopu")

it55.com

    set the castnum of sprite 6 to member("ru") http://www.it55.com/

    set the castnum of sprite 7 to member("rau")

www.it55.com在线教程

  updatestage 45398 www.it55.com it55学习IT知识,享受IT生活 4dfkjn

  set the movierate of sprite 1 to2 45398 www.it55.com it55学习IT知识,享受IT生活 4dfkjn

end www.it55.com在线教程

vd;k;l www.it55.com rdfg

7-153  精灵3的脚本 45398 www.it55.com it55学习IT知识,享受IT生活 4dfkjn

(10) 选中舞台上的精灵4,打开Script窗口为其添加以下的Lingo语句,如图7-154所示。

vd;k;l www.it55.com rdfg

on mouseUp me

免费资源www.it55.com

  set the movierate of sprite 1 to 1

sflj www.it55.com kg^&fgd

  set the castnum of sprite 2 to member("lau") 45398 www.it55.com it55学习IT知识,享受IT生活 4dfkjn

  set the castnum of sprite 3 to member("lu")

45398 www.it55.com it55学习IT知识,享受IT生活 4dfkjn

  set the castnum of sprite 5 to member("stopu") 45398 www.it55.com it55学习IT知识,享受IT生活 4dfkjn

  set the castnum of sprite 6 to member("ru") 45398 www.it55.com it55学习IT知识,享受IT生活 4dfkjn

  set the castnum of sprite 7 to member("rau") sflj www.it55.com kg^&fgd

end

www.it55.com在线教程

IT资讯之家 www.it55.com

7-154  精灵4Lingo脚本

www.it55.com在线教程

(11) 选中舞台上的精灵5,打开Script窗口为其添加以下的Lingo语句,如图7-155所示。 vd;k;l www.it55.com rdfg

on mouseUp me www.it55.com在线教程

  if (the castnum of sprite 7 = 8) then it55.com

    set the movietime of sprite 1 to the duration of the member of sprite 1

sflj www.it55.com kg^&fgd

    set the castnum of sprite 2 to member("lau") sflj www.it55.com kg^&fgd

    set the castnum of sprite 3 to member("lu")

免费资源www.it55.com

    set the castnum of sprite 4 to member("playd") it55.com

    set the castnum of sprite 5 to member("stopu") http://www.it55.com/

    set the castnum of sprite 6 to member("rd")

免费资源www.it55.com

    set the castnum of sprite 7 to member("rad")

www.it55.com

    updatestage vd;k;l www.it55.com rdfg

  end if 免费资源www.it55.com

end

IT资讯之家 www.it55.com

IT资讯之家 www.it55.com

7-155  精灵5Lingo脚本

IT资讯之家 www.it55.com

(12) 选中舞台上的精灵6,打开Script窗口为其添加以下的Lingo语句,如图7-156所示。

it55.com

on mouseUp me

www.it55.com

  set the movierate of sprite 1 to 2

www.it55.com在线教程

  set the castnum of sprite 2 to member("lau")

vd;k;l www.it55.com rdfg

  set the castnum of sprite 3 to member("lu") www.it55.com

  set the castnum of sprite 4 to member("playu") http://www.it55.com/

  set the castnum of sprite 5 to member("stopu") 45398 www.it55.com it55学习IT知识,享受IT生活 4dfkjn

  set the castnum of sprite 6 to member("rd")

www.it55.com在线教程

  set the castnum of sprite 7 to member("rau")

sflj www.it55.com kg^&fgd

  updatestage

www.it55.com在线教程

end

www.it55.com

45398 www.it55.com it55学习IT知识,享受IT生活 4dfkjn

7-156  精灵6Lingo脚本

www.it55.com在线教程

(13) 选中舞台上的精灵7,打开Script窗口为其添加以下的Lingo语句,如图7-157所示。

45398 www.it55.com it55学习IT知识,享受IT生活 4dfkjn

on mouseUp me 免费资源www.it55.com

  if (the castnum of sprite 5 = 12) then IT资讯之家 www.it55.com

    set the movierate of sprite 1 to 0

it55.com

    set the castnum of sprite 5 = member("stopd") it55.com

    updatestage www.it55.com

  end if

vd;k;l www.it55.com rdfg

end 免费资源www.it55.com

vd;k;l www.it55.com rdfg

7-157  精灵7Lingo脚本 www.it55.com

(14) 至此,AVI播放器动画的制作完成了,播放电影,效果如图7-158所示。

www.it55.com在线教程

http://www.it55.com/

7-158  AVI播放器播放效果 sflj www.it55.com kg^&fgd

(编辑:IT资讯之家 www.it55.com

返回顶部
 
上一篇:键盘控制制作   下一篇:显示日期制作

网友评论

[以下评论为网友观点,不代表本站。请自觉遵守互联网相关政策法规,所有连带责任均有评论者自负。]
[不超过250字]