在Director中应用Flash-Part III从Director到 Flash
| 在Director中应用Flash – Part III. 从director到 Flash |
Part III. 从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 里有声音文件, 声音部分不受影响, 继续播放。 5. 速度控制(Controlling the Speed) 请记住,Flash 的frameRate是可以测试但不可设定的属性。 但是作为Flash member 或sprite的属性- fixedRate却是可以设定的。例如Director 8 帮助文件里的这个例子: on adjustFixedRate whichSprite, adjustType, howMuch case adjustType of #faster: sprite(whichSprite).fixedRate =/ sprite(whichSprite).fixedRate + howMuch #slower: sprite(whichSprite).fixedRate =/ sprite(whichSprite).fixedRate - howMuch end case end 6. 跳转到某一帧(Go to one particular frame) Sprite(whichFlashSprite).goToFrame(frameNumber) 记得这里的goToFrame是一个词。 除了以上这些基本的控制外,还有一些Flash sprite的专有属性, 例如: mouseOverButton, playBackMode, frameCount, pausedAtStart, actionEnabled, buttonsEnabled, clickMode, eventPassMode, 在Director的帮助文件里都有详细的解释, 我这里就不多费口舌了。好吧, 这次就到这儿, 下次我们要讨论一些进深的内容, 包括movieClip 的控制, 还有Flash 在Director 里的performance control. |

