【发布时间】:2010-04-08 19:18:47
【问题描述】:
我在带有 watch 按钮的电影中有 4 帧中的四个电影剪辑 (.f4v)。这些 f4v 已被导入到具有下一个和上一个按钮的主电影容器中。但是,如果我播放电影然后点击下一帧,电影将继续在后台播放。我怎么买这个?下面的代码显示了其中一个影片剪辑的动作脚本,然后是主影片中的动作脚本。我是一个闪光新手,所以所有的帮助表示赞赏。 非常感谢。
stop();
watch1_btn.addEventListener(MouseEvent.CLICK, playMovie1);
function playMovie1(event:MouseEvent):void
{
movie1_mc.play();
}
// Button Listeners
next_btn.addEventListener(MouseEvent.CLICK, nextSection);
prev_btn.addEventListener(MouseEvent.CLICK, prevSection);
function nextSection(event:MouseEvent):void {
var thisLabel:String = pages_mc.currentLabel; // gets current frame label as string
var thisLabelNum:String = thisLabel.replace("sct", ""); // cuts the leading letters off of the number
var curNumber:Number = Number(thisLabelNum); // converts that string number to a real number
if (curNumber < 5){
var nextNum:Number = curNumber + 1; // adds 1 to the number so we can go to next frame label
pages_mc.gotoAndStop("sct" + nextNum); // This allows us to go to the next frame label
}
}
///////////////////////////////////////////////////////////////////////////
function prevSection(event:MouseEvent):void {
var thisLabel:String = pages_mc.currentLabel; // gets current frame label as string
var thisLabelNum:String = thisLabel.replace("sct", ""); // cuts the leading letters off of the number
var curNumber:Number = Number(thisLabelNum); // converts that string number to a real number
var prevNum:Number = curNumber - 1; // subtracts 1 from the number so we can go to next frame label
pages_mc.gotoAndStop("sct" + prevNum); // This allows us to go to the previous frame label
}
【问题讨论】: