用户名: 密码: 免费注册 忘记密码? 网站地图 | 加入收藏 | 设为首页
首页 | 新闻 | 工具 | 系统 | 办公 | 聊天 | 多媒体 | 网页 | 运营 | 平面 | 欣赏 | 数据库 | 程序 | 服务器 | 组网
网页 | 3dmax | Ghost | Windows Xp| Dreamweaver | photoshop | Flash | office | Alexa | Css | QQ | Asp | PHP | Jsp | Access
Flash MX 2004入门 | 网站推广策略 | CorelDRAW入门 | ASP学习 | 网站建设大师功 | Word入门
  iTbulo.com > 学院 > 多媒体教程 > Director教程 > 文章正文
AVI播放器制作
iTbulo.COM 2005-12-9 未知()
AVI播放器制作

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

*  AVI播放器制作操作步骤如下:

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

7-145  设置舞台的属性

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

7-146  导入12张图片

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

7-147  导入AVI电影

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

7-148  生成精灵1

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

7-149  生成精灵

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

on startmovie

  set the movierate of sprite 1 to 0

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

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

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

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

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

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

end

7-150  Movie脚本

(7) 双击Script通道的第2帧单元格,打开Script窗口,输入以下Lingo语句,如图7-151所示。

on exitFrame me

  go to the frame

end

7-151  2帧的Lingo脚本

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

on mouseUp me

  set the movietime of sprite 1 to 0

  set the movierate of sprite 1 to 0

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

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

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

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

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

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

  updatestage

end

7-152  精灵2Lingo脚本

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

on mouseUp me

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

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

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

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

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

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

  updatestage

  set the movierate of sprite 1 to2

end

7-153  精灵3的脚本

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

on mouseUp me

  set the movierate of sprite 1 to 1

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

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

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

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

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

end

7-154  精灵4Lingo脚本

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

on mouseUp me

  if (the castnum of sprite 7 = 8) then

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

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

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

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

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

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

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

    updatestage

  end if

end

7-155  精灵5Lingo脚本

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

on mouseUp me

  set the movierate of sprite 1 to 2

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

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

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

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

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

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

  updatestage

end

7-156  精灵6Lingo脚本

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

on mouseUp me

  if (the castnum of sprite 5 = 12) then

    set the movierate of sprite 1 to 0

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

    updatestage

  end if

end

7-157  精灵7Lingo脚本

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

7-158  AVI播放器播放效果

文章搜索
相关资讯
相关文章 相关下载
没有相关文章
焦点信息