很多按钮,分别跳到第2帧,3帧,N帧。我这样写的话要写一堆。
怎样只写一个function,然后调用的时候加一个数字就可以跳到相应的帧呢?
function detailshow2(event:MouseEvent) {
gotoAndPlay(2);
}
function detailshow3(event:MouseEvent) {
gotoAndPlay(3);
}
btn1.addEventListener(MouseEvent.MOUSE_UP,detailshow2);
btn2.addEventListener(MouseEvent.MOUSE_UP,detailshow3);
谢谢各位。
怎样只写一个function,然后调用的时候加一个数字就可以跳到相应的帧呢?
function detailshow2(event:MouseEvent) {
gotoAndPlay(2);
}
function detailshow3(event:MouseEvent) {
gotoAndPlay(3);
}
btn1.addEventListener(MouseEvent.MOUSE_UP,detailshow2);
btn2.addEventListener(MouseEvent.MOUSE_UP,detailshow3);
谢谢各位。