在Director中应用Flash——从Director到Flash

王朝other·作者佚名  2008-05-21
宽屏版  字体: |||超大  

说完了Flash 控制Director, 轮到Director来控制导入的Flash了, 在Director里, 你主要要学习控制Flash 的播放, 以Flash 文件本身的一些属性, 如缩放, 旋转等, 如果导入的是Flash 4格式的文件, 使用了GetProperty , SetProperty 等版本3没有的ActionScript, Director可以进一步来获取Flash 里MovieClip的属性, 从而使得这两者之间的整合再上一层楼, 不过这部分内容已超出基础篇的范围, 以后有机会单独讲解。这里主要使用一些最基本的功能。

1. 正常播放(Playing)

Sprite(whichFlashSprite).play()

这里使用Director 7 and 8 所使用的dot syntax. 括号里的whichFlashSprite, 你替换成相应的Flash 所在的通道号就可以了。如果Flash sprite目前是暂停的, play 指令将会使Flash sprite 从所停止的那一帧开始播放, 而不是从头播放。

2. 步进与步退(Stepping frame by frame)

Sprite(whichFlashSprite).frame = sprite(whichFlashSprite).frame + 1

或者

Sprite(whichFlashSprite).frame = sprite(whichFlashSprite).frame - 1

这也比较容易理解, 结合 mouseUp 事件你就可以一帧一帧的步进或步退。

3. 倒退回第一帧(Rewinding)

Sprite(whichFlashSprite).rewind()

4. 停止(Stopping)

Sprite(whichFlashSprite).stop()

这时Flash会停止在当前的帧上。而不是返回第一帧。

或者

Sprite(whichFlashSprite).hold()

同样Flash会停止在当前的帧上, 不过如果Flash 里有声音文件, 声音部分不受影响, 继续播放。

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有