首页 > 娱乐 > Director教程-AVI播放器制作(一)
Director教程-AVI播放器制作(一)
网上收集 2008/2/25 8:13:09 (361)
Director 8.5支持多种视频格式,包括常用的MOV和AVI视频格式。本节实例将介绍创建AVI播放器,通过控制按钮,可以对AVI进行视频播放、停止、快进、快退等操作。
 AVI播放器制作操作步骤如下:
(1) 进入Director 8.5。执行Modify→Movie→Properties命令,在弹出的舞台属性检查器对话框中将电影舞台的大小设置为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演员lau、lu、playu、stopu、ru、rau,分别拖动到舞台上,生成精灵2、3、4、5、6、7,调整位置如图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  精灵2的Lingo脚本
阅读(361) (责任编辑:城市网)
关于我们 - 联系我们 - 网站荣誉 - 广告服务 - 版权声明 - 网站地图
Copyright© 2007-2018 bj1.com.cn 首都热线 版权所有 QQ:165687462
中国·北京 粤ICP备14047004号-20