写着玩的,代码插入第一帧即可。
if (flag != 1) {
createEmptyMovieClip("ba", 9);
ba.lineStyle(1, 0xff0000, 100);
ba.lineTo(100, 0);
ba._y = Stage.width/1.5;
ba._x = Stage.height/2;
ba.createEmptyMovieClip("hk", 11);
ba.hk._x = 1;
ba.hk.lineStyle(10, 0x000ff, 100);
ba.hk.lineTo(0, 1);
ba.createTextField("txt", 100, 0, 10, 200, 50);
ba.txt.text = "调整波长";
var n:Number = 1;
var bochang:Number;
var zuo:Number = ba.hk._x;
var din:Number = ba.hk._y;
var you:Number = zuo+100;
var di = din;
_root.ba.hk.onPress = function() {
this.startDrag(flase, zuo, din, you, di);
};
ba.hk.onRelease = function() {
this.stopDrag();
};
ba.hk.onReleaseOutside = function() {
this.stopDrag();
};
createEmptyMovieClip("a", 10);
a.lineStyle(6, 0xff0000, 100);
a.lineTo(1, 1);
a._x = 500;
a._y = 500;
var i = a._height;
var f = 1;
var v = 50;
flag = 1;
}
闪吧菜鸟kingofkofs = onEnterFrame=function () {
a._x += bochang;
_x -= bochang;
ba._x += bochang;
a._y += (Stage.height/2-a._y)/1.08*2.05;
lineStyle(1, 0x0055ff, 100);
lineTo(a._x, a._y);
bochang = (ba.hk._x)/10+1;
f++;
if (f == 30) {
n += (300-n)/10;
if (n>250) {
n = 140;
}
a._y = n;
f = 0;
}
};
进入论坛讨论学习:
http://space.flash8.net/bbs/thread-339406-1-5.html