flash as3.0问题,请问怎么简化下面的代码呀?在线等 50
a1,a2,a3,a4分别是4个影片剪辑,每个影片剪辑有两帧,都停在第一帧,要在鼠标分别点击的时候,分别变成第二帧,一个一个写代码太麻烦了,请问怎么简化一下:a1.add...
a1,a2,a3,a4分别是4个影片剪辑,每个影片剪辑有两帧,都停在第一帧,要在鼠标分别点击的时候,分别变成第二帧,一个一个写代码太麻烦了,请问怎么简化一下:
a1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);
function fl_ClickToGoToAndStopAtFrame(event:MouseEvent):void
{
a1.gotoAndStop(2);
}
a2.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_2);
function fl_ClickToGoToAndStopAtFrame_2(event:MouseEvent):void
{
a2.gotoAndStop(2);
}
a3.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_3);
function fl_ClickToGoToAndStopAtFrame_3(event:MouseEvent):void
{
a3.gotoAndStop(2);
}
a4.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_4);
function fl_ClickToGoToAndStopAtFrame_4(event:MouseEvent):void
{
a4.gotoAndStop(2);
} 展开
a1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);
function fl_ClickToGoToAndStopAtFrame(event:MouseEvent):void
{
a1.gotoAndStop(2);
}
a2.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_2);
function fl_ClickToGoToAndStopAtFrame_2(event:MouseEvent):void
{
a2.gotoAndStop(2);
}
a3.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_3);
function fl_ClickToGoToAndStopAtFrame_3(event:MouseEvent):void
{
a3.gotoAndStop(2);
}
a4.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_4);
function fl_ClickToGoToAndStopAtFrame_4(event:MouseEvent):void
{
a4.gotoAndStop(2);
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询