WEB开发网
开发学院图形图像Flash 用Flash AS模拟声波振荡效果 阅读

用Flash AS模拟声波振荡效果

 2007-08-02 11:08:25 来源:WEB开发网   
核心提示:写着玩的,代码插入第一帧即可,用Flash AS模拟声波振荡效果,if (flag != 1) {createEmptyMovieClip("ba", 9);ba.lineStyle(1, 0xff0000, 100);ba.lineTo(100, 0);ba._y = Stage.width/1.

写着玩的,代码插入第一帧即可。

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;
}
};

Tags:Flash AS 模拟

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接