当前位置:软件学习 > Director >>

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

说完了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 里有声音文件, 声音部分不受影响, 继续播放。
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,