我在这里尝试做的是在我单击它时使按钮移动,然后当我再次单击该按钮时它会移动到原始位置。但是,当我在 Flash 上运行此按钮时,当我第一次单击它时,该按钮仅移动一次,但是当我再次单击它时,它不会移回其位置。任何帮助都会非常感谢。
stop();
import flash.events.MouseEvent;
var step1click;
var step2click;
button1.addEventListener(MouseEvent.CLICK, positionswitch);
function positionswitch(event:MouseEvent):void
{
button1.x = 426;
button1.x = 266;
step1click = 1
}
if(step1click == 1) {
button1.addEventListener(MouseEvent.CLICK, positionswitch2);
function positionswitch2(event:MouseEvent):void
{
button1.x = 156;
button1.y = 253;
step2click = 1;
}
}
if(step2click == 1){
button1.addEventListener(MouseEvent.CLICK, positionswitch3);
function positionswitch3(event:MouseEvent):void
{
button1.x = 426;
button1.y = 266;
}
}