【发布时间】:2013-04-12 01:10:43
【问题描述】:
我正在 Actionscript 2.0 / Flash Player 7 中的 Flash CS4 中创建动画
目前我有一个名为 myHolder 的处理程序(电影剪辑),当通过按钮调用时,它用于播放一个主 swf 文件中的其他 swf 文件
在将 swf 加载到主时间线的按钮内 - 例如
on (press)
{
loadMovie("BulletTrainDRAFT.swf", myHolder);
}
这可以很好地将其他 swf 文件带入主 swf 文件时间线,但是当我带入一个包含视频的视频控件的 swf 文件时,它们在播放时不会在处理程序中响应,但它们确实可以工作该 swf 文件在其自己的外部 Flash 播放器窗口中播放(视频在其设计 fla 内其自己的时间轴上的(电影剪辑)内)
视频按钮 - ActionScript 2.0
btnStop.onPress = function(){
_root.vid.stop();
}
btnPlay.onPress = function(){
_root.vid.play();
}
btn_fastforward.onPress = function(){
_root.vid.nextFrame();
}
btn_Rewind.onPress = function(){
_root.vid.prevFrame();
}
我也尝试了 ActionScript 3.0 代码
Pausebtn.addEventListener(MouseEvent.CLICK,pauseHandler);
Stopbtn.addEventListener(MouseEvent.CLICK, stopHandler);
Playbtn.addEventListener(MouseEvent.CLICK,playHandler);
function stopHandler(event:MouseEvent):void {
// Pause the stream and move the playhead back to
// the beginning of the stream.
video.gotoAndStop(1);
}
function playHandler(event:MouseEvent):void {
// Pause the stream and move the playhead back to
// the beginning of the stream.
video.play();
}
function pauseHandler(event:MouseEvent):void {
// Pause the stream and move the playhead back to
// the beginning of the stream.
video.stop();
}
我认为的问题是,外部 swf 在现有时间轴上加载的电影作为一个孩子并且没有卸载时间轴导致动作脚本不起作用,但我无法解决这个问题。
【问题讨论】:
-
什么是_root.video?如果 SWF 被加载到 myHolder 并且您想控制它的主时间线,例如停止它,那么您需要使用 myHolder.stop()。有一个加载时间,所以你应该看看 MovieClipLoader 类(在 AS2 中)。
-
这个问题现在已经解决了,不过再次感谢您的建议和帮助^_^
标签: actionscript-2 flash