gotoAndStop()参数只能是常量?
actionscript吧
全部回复
仅看楼主
level 1
var i:uint=0;
while(i = (i+1)%3)
{
......this["b"+i].addEventListener(MouseEvent.CLICK,eventer);
}
function eventer(e:MouseEvent):void
{
......var num:uint;
......switch(e.currentTarget.name)
......{
............case "b1":
..................num = 1;
..................break;
............case "b2":
..................num = 2;
......}
......if ( true == this["cnumber"+num] )
......{
............this["cnumber"+num] = false;
............this["c"+num].gotoAndStop(1);
............this["a"+num].gotoAndStop(1);
......}
......else
......{
............this["cnumber"+num] = true;
............this["c"+num].gotoAndStop(2);
............this["a"+num].gotoAndStop(2);
......}
}
因为有重复,所以改成了下面这样,但改完后发现元件没反应了,是什么情况?
num还是那些数 , 为什么不跳转帧了?求大神解答
2015年05月25日 16点05分 1
level 1
var i:uint=0;
while(i = (i+1)%3)
{
......this["b"+i].addEventListener(MouseEvent.CLICK,eventer);
}
function eventer(e:MouseEvent):void
{
......var num:uint;
......switch(e.currentTarget.name)
......{
............case "b1":
..................num = 1;
..................break;
............case "b2":
..................num = 2;
......}
......if ( true == this["cnumber"+num] )
......{
............this["cnumber"+num] = false;
......}
......else
......{
............this["cnumber"+num] = true;
......}
......this["c"+num].gotoAndStop(num);
......this["a"+num].gotoAndStop(num);
}
2015年05月25日 16点05分 4
1