flash高手来看看!!

来源:百度知道 编辑:UC知道 时间:2024/07/13 14:37:50
我这里有个问题,,,

我设计了三个影片剪辑 x1 x2 x3
(内容是出现三个方方的东西)
我在第1帧和第30帧设计二个stop();
(这三个影片剪辑都有二个stop)

设计了三个按钮(f1 f2 f3)来控制这三个x1 x2 x3(三个影片剪辑)

可是问题出来了。

我按了f1出现了x1出来了

我按下f2 出现了x2
这时x1不会回到第1帧,
怎么设计才能出现x2或者x3 让x1回到第1帧

希望你能看明白,,

f1.onRelease = function() {
x1.gotoAndPlay(2);
}
f2.onRelease = function() {
x2.gotoAndPlay(2);
}
f3.onRelease = function() {
x3.gotoAndPlay(2);
}
我是这样想的,,,
按下f1 x1出现
按下f2 x2出现。但同进x1回到第一帧

希望大家能明白,

你们太天真了,,,如果有20个按钮怎么办!!f1-f20
20个按钮呀,同学,,,你这样太费时间了

f1.onRelease = function() {
x1.play();
x2.gotoAndStop(1);
x3.gotoAndStop(1);
};
f2.onRelease = function() {
x2.play();
x1.gotoAndStop(1);
x3.gotoAndStop(1);
};
f3.onRelease = function() {
x3.play();
x1.gotoAndStop(1);
x2.gotoAndStop(1);
};
我试过,这样行

20个以上的对象 请大胆使用数组与for循环 你想学啊?我教你

哎~无从下嘴啊~那你就把三个影片剪辑里的第二个“stop”都去掉~试试? (这样的话影片剪辑会自动播放一圈回到第一帧!如果想按第二个按钮的时候第一个影片剪辑才回到第一帧,那就要在第二个按钮上加个函数~具体我不能说明白,抱歉啊~o(∩_∩)o...哈哈)

f1.onRelease = function() {
x1.gotoAndPlay(2);
x2.gotoAndStop(1);
x3.gotoAndStop(1);
}

f2.onRelease = function() {
x2.gotoAndPlay(2);
x1.gotoAndStop(1);
x3.gotoAndStop(1);
}

f3.onRelease = function() {
x3.gotoAndPlay(2);
x1.gotoAndStop(1);
x3.gotoAndStop(1);
}

试一试。

这一点都算麻烦啊?呵呵,看来你很懒,你要是看见那些实例里面密密麻麻的AS那你更受不了。

实际上,虽然看上去行数多,道理却很简单,就是一个出来的同时其余的都进去,就像套公式一样,复