【问题标题】:Loading external SWF in Actionscript 2在 Actionscript 2 中加载外部 SWF
【发布时间】: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


【解决方案1】:

已通过添加解决此问题

this._lockroot=true

在adobe论坛上获得一些帮助后,转到视频主fla时间轴^_^

再次感谢大家的帮助

【讨论】:

    猜你喜欢
    • 2011-04-04
    • 1970-01-01
    • 1970-01-01
    • 2011-03-29
    • 2011-11-01
    • 2011-02-12
    • 2011-01-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多