Flash as3.0用按钮控制播放

2025-01-31 23:48:00
推荐回答(2个)
回答1:

首先确认你那个play_btn是否是可交互的,影片剪辑或者按钮类型的。然后,play是当前帧所属的影片剪辑的方法,不接收参数,addEventListener方法接收的函数必须能传进一个类型为Event的参数,因此你大概可以这样
play_btn.addEventListener(MouseEvent.CLICK,playThis);
function playThis(e:MouseEvent):void
{
play();
//其它操作
}

回答2:

play_btn.addEventListener(MouseEvent.CLICK,play);

function fl_ClickToGoToAndPlayFromFrame(event:MouseEvent):void
{
gotoAndPlay(5);
}

改成:
play_btn.addEventListener(MouseEvent.CLICK,player);

function player(event:MouseEvent):void
{
gotoAndPlay(5);
}