五月综合缴情婷婷六月,色94色欧美sute亚洲线路二,日韩制服国产精品一区,色噜噜一区二区三区,香港三级午夜理伦三级三

您現(xiàn)在的位置: 365建站網(wǎng) > 365文章 > 鼠標(biāo)跟隨

鼠標(biāo)跟隨

文章來源:365jz.com     點(diǎn)擊數(shù):560    更新時間:2007-12-30 16:54   參與評論
先看效果
 點(diǎn)擊瀏覽該文件

因?yàn)槿莂s編寫的,所以我就不放源文件了,只要把a(bǔ)s代碼復(fù)制到flash里的第一幀就可以了

Stage.scaleMode = "noScale"
Stage.align = "TL"
for (i=1; i<=4; i++) {
_root.createEmptyMovieClip("point"+i, 0-i);//新建MC
//mc的x軸,y軸
_root["point"+i]._x = Stage.width/2;
_root["point"+i]._y = Stage.height/2;
//鼠標(biāo)劃過的效果
_root["point"+i].onMouseMove = function() {
this._x = _root._xmouse+(Math.random()*70)-35;
this._y = _root._ymouse+(Math.random()*70)-35;
};
}
//設(shè)定一個顏色組
hexColors = new Array("0xCC00FF", "0xCC33FF", "0xCC66FF", "0xCC99FF", "0xCCCCFF", "0xCCFFFF");
//鼠標(biāo)劃過時新建mc,并隨機(jī)填充顏色和隨機(jī)設(shè)alpha值
this.onMouseMove = function() {
i++;
this.createEmptyMovieClip("shape"+i, i *10);
with (this["shape"+i]) {
beginFill(hexColors[Math.floor(Math.random()*hexColors.length)], (Math.random()*40)+60);
//執(zhí)行畫線程序
moveTo(_root.point1._x, _root.point1._y);
curveTo(_root.point2._x, _root.point2._y, _root.point3._x, _root.point3._y);
curveTo(_root.point4._x, _root.point4._y, _root.point1._x, _root.point1._y);
endFill();
}
//復(fù)制當(dāng)前mc,設(shè)X,Y軸,alpha值,并填充顏色,做為陰影。
this["shape"+i].duplicateMovieClip("shadow"+i, (10*i)-1);
this["shadow"+i]._x = this["shape"+i]._x -6;
this["shadow"+i]._y = this["shape"+i]._y + 6;
this["shadow"+i]._alpha = 60;
this.grey = new Color(this["shadow"+i]);
this.grey.setRGB("0x999999");
};

只做了簡單的解釋,適合有as基礎(chǔ)的朋友學(xué)習(xí)

Stage.scaleMode = "noScale";
Stage.align = "TL";
for (i=1; i<=4; i++) {
_root.createEmptyMovieClip("point"+i, 0-i);
//新建MC
//mc的x軸,y軸
_root["point"+i]._x = Stage.width/2;
_root["point"+i]._y = Stage.height/2;
//鼠標(biāo)劃過的效果
_root["point"+i].onMouseMove = function() {
this._x = _root._xmouse+(Math.random()*70)-35;
this._y = _root._ymouse+(Math.random()*70)-35;
};
}
//設(shè)定一個顏色組
hexColors = new Array("0xCC00FF", "0xCC33FF", "0xCC66FF", "0xCC99FF", "0xCCCCFF", "0xCCFFFF");
//鼠標(biāo)劃過時新建mc,并隨機(jī)填充顏色和隨機(jī)設(shè)alpha值
this.onMouseMove = function() {
i++;
this.createEmptyMovieClip("shape"+i, i*10);
with (this["shape"+i]) {
beginFill(hexColors[Math.floor(Math.random()*hexColors.length)], (Math.random()*40)+60);
//執(zhí)行畫線程序
moveTo(_root.point1._x, _root.point1._y);
curveTo(_root.point2._x, _root.point2._y, _root.point3._x, _root.point3._y);
curveTo(_root.point4._x, _root.point4._y, _root.point1._x, _root.point1._y);
endFill();
}
//復(fù)制當(dāng)前mc,設(shè)X,Y軸,alpha值,并填充顏色,做為陰影。
this["shape"+i].duplicateMovieClip("shadow"+i, (10*i)-1);
this["shadow"+i]._x = this["shape"+i]._x-6;
this["shadow"+i]._y = this["shape"+i]._y+6;
this["shadow"+i]._alpha = 60;
this.grey = new Color(this["shadow"+i]);
this.grey.setRGB("0x999999");
};
//加了一段刪除的
var ii:Number = 6;
function del() {
if (_root["shape"+ii]) {
_root["shape"+ii].removeMovieClip();
_root["shadow"+ii].removeMovieClip();
ii++;
}
}
setInterval(del, 10);

點(diǎn)擊瀏覽該文件

原來的其實(shí)更好看,越改越不好看了

import mx.transitions.Tween;
import mx.transitions.easing.*;
var i:Number = 0;
var mcname:Number = 0;
var x:Number = _xmouse, y:Number = _ymouse;
var rgb:Array = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F");
var mousemove:Object = new Object();
mousemove.onMouseMove = function() {
fline();
};
function fline() {
var a:Number = Math.floor(Math.random()*16);
var b:Number = Math.floor(Math.random()*16);
var c:Number = Math.floor(Math.random()*16);
var d:Number = Math.floor(Math.random()*16);
var e:Number = Math.floor(Math.random()*16);
var f:Number = Math.floor(Math.random()*16);
var g:Number = Math.floor(Math.random()*6);
this.createEmptyMovieClip("line"+i, i);
mycolor = new Color(this["line"+i]);
mycolor.setRGB("0x"+rgb[a]+rgb[b]+rgb[c]+rgb[d]+rgb[e]+rgb[f]);
with (this["line"+i]) {
lineStyle(g, 0x0000, 100);
moveTo(x, y);
lineTo(_xmouse, _ymouse);
}
x = _xmouse;
y = _ymouse;
mcname_mc = this["line"+i];
i++;
}
setInterval(enterframes, 10);
function enterframes() {
if (_root["line"+mcname]) {
fdown(_root["line"+mcname]);
mcname++;
}
}
function fdown(mc_mc:MovieClip) {
var i:Number = mc_mc._y;
down = new Tween(mc_mc, "_y", Elastic.easeIn, i, i+200, 1, true);
down.onMotionStopped = function() {
mc_mc.removeMovieClip();
};
}
Mouse.addListener(mousemove);


點(diǎn)擊瀏覽該文件

點(diǎn)擊瀏覽該文件
原來的:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var i:Number = 0;
var mcname:Number = 0;
var x:Number = _xmouse, y:Number = _ymouse;
var mousemove:Object = new Object();
mousemove.onMouseMove = function() {
fline();
};
function fline() {
var a:Number = Math.random()*5;
var b:Number = Math.random()*100;
this.createEmptyMovieClip("line"+i, i);
with (this["line"+i]) {
lineStyle(1, 0x0000, 100);
moveTo(x, y);
lineTo(_xmouse, _ymouse);
}
x = _xmouse;
y = _ymouse;
mcname_mc = this["line"+i];
i++;
}
setInterval(enterframes, 10);
function enterframes() {
if (_root["line"+mcname]) {
fdown(_root["line"+mcname]);
mcname++;
}
}
function fdown(mc_mc:MovieClip) {
var i:Number = mc_mc._y;
down = new Tween(mc_mc, "_y", Elastic.easeIn, i, i+200, 1, true);
down.onMotionStopped = function() {
mc_mc.removeMovieClip();
};
}
Mouse.addListener(mousemove);

點(diǎn)擊瀏覽該文件

如對本文有疑問,請?zhí)峤坏浇涣髡搲瑥V大熱心網(wǎng)友會為你解答??! 點(diǎn)擊進(jìn)入論壇

發(fā)表評論 (560人查看,0條評論)
請自覺遵守互聯(lián)網(wǎng)相關(guān)的政策法規(guī),嚴(yán)禁發(fā)布色情、暴力、反動的言論。
昵稱:
最新評論
------分隔線----------------------------

其它欄目

· 建站教程
· 365學(xué)習(xí)

業(yè)務(wù)咨詢

· 技術(shù)支持
· 服務(wù)時間:9:00-18:00
365建站網(wǎng)二維碼

Powered by 365建站網(wǎng) RSS地圖 HTML地圖

copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號