|
|
楼主 |
发表于 2015-3-14 14:28:33
|
显示全部楼层
1、新建as2.0文档,设置默认。
2、插入名为“彩弧”的影片剪辑,绘制一七彩正圆,建议宽160;按Ctrl+D直接复制该圆,拖动使之盖住原彩圆下部约90%的面积,删除后留下上部月牙儿型的彩弧,左对齐,底对齐;回到库,给该元件输入标识符mc。
3、回到主场景,图层1(背景):略。
图层2(按钮):制作两个按钮(“内收”和“外展”),实例名ns、wz,并重叠放置。
图层3(as):该层第1帧输入以下语句:
this.createEmptyMovieClip("m", 0);
this.createEmptyMovieClip("n", -1);
for (i=1; i<=18; i++) {
a = m.attachMovie("mc", "m"+i, i);
b = n.attachMovie("mc", "n"+i, i+20);
a._rotation = b._rotation=(i-1)*20;
}
m._xscale = -100;
m._x = n._x=Stage.width/2;
m._y = n._y=Stage.height/2;
function aa(x) {
this.onEnterFrame = function() {
m._rotation += x;
n._rotation += -x;
};
}
aa(random(3)+2);
ns._visible = 1;
wz._visible = 0;
ns.onPress = function() {
aa(-(random(3)+2));
this._visible = 0;
wz._visible = 1;
};
wz.onPress = function() {
aa(random(3)+2);
this._visible = 0;
ns._visible = 1;
};
测试,OK! |
|