用Flash AS編寫(xiě)的蝌蚪特效動(dòng)畫(huà)_Flash教程
推薦:怎么用地圖控制flash移動(dòng)演示效果:(用鼠標(biāo)在小地圖中任意拖拽可以看到效果)問(wèn):怎么用地圖控制flash移動(dòng),像QQ寵物村一樣,在右上角有幅地圖,可以控制左邊的flash的移動(dòng)?答:運(yùn)用
效果查看:
場(chǎng)景里代碼:
Object.environment = this;
Math.prototype.degrees = function (r)
{
return (r * 180 / 3.141593E 000);
};
maxtents = 3;
this.onEnterFrame = function ()
{
if (!random(30) && tents < maxtents)
{
var nombre = "tent" String(depth );
var neo = this.attachMovie("tentacle", nombre, depth);
neo._x = random(600);
neo._y = 370;
neo.theta = 270;
tents;
} // end if
};
stop ();
MC里的代碼:
#initclip 1
function TentacleClass()
{
this.numNodes = 27;
this.head = 2 random(4);
this.girth = 8 random(12);
this.speedCoefficient = 9.000000E-002 random(10) / 50;
this.friction = 9.000000E-001 random(10) / 100;
this.muscleRange = 20 random(50);
this.muscleFreq = 1.000000E-001 random(100) / 250;
this.generateNodes();
this.onEnterFrame = this.move;
} // End of the function
TentacleClass.prototype = new MovieClip();
TentacleClass.prototype.generateNodes = function ()
{
this.node = new Array();
var n = 0;
while (n < this.numNodes)
{
var point = {x: 0, y: 0};
this.node.push(point);
n;
} // end while
};
TentacleClass.prototype.move = function ()
{
this.tv = this.tv 5.000000E-001 * (Math.random() - Math.random());
this.theta = this.theta this.tv;
this.tv = this.tv * this.friction;
this.node[0].x = this.head * Math.cos(1.745329E-002 * this.theta);
this.node[0].y = this.head * Math.sin(1.745329E-002 * this.theta);
this.count = this.count this.muscleFreq;
this.thetaMuscle = this.muscleRange * Math.sin(this.count);
this.node[1].x = -this.head * Math.cos(1.745329E-002 * (this.theta this.thetaMuscle));
this.node[1].y = -this.head * Math.sin(1.745329E-002 * (this.theta this.thetaMuscle));
var i = 2;
while (i < this.numNodes)
{
var dx = this.node.x - this.node[i - 2].x;
var dy = this.node.y - this.node[i - 2].y;
var d = Math.sqrt(dx * dx dy * dy);
this.node.x = this.node[i - 1].x dx * this.girth / d;
this.node.y = this.node[i - 1].y dy * this.girth / d;
if (i == 2)
{
this._x = this._x - dx * this.speedCoefficient;
this._y = this._y - dy * this.speedCoefficient;
if (this._x this._width < 0 || this._x - this._width > 600 || this._y this._height < 0 || this._y - this._height > 400)
{
--Object.environment.tents;
this.removeMovieClip();
} // end if
} // end if
i;
} // end while
this.clear();
this.moveTo(this.node[1].x, this.node[1].y);
var i = 2;
while (i < this.numNodes)
{
this.lineStyle(int(this.numNodes - i) * (this.numNodes - i) / 20, 16777215, 100);
this.lineTo(this.node.x, this.node.y);
i;
} // end while
};
Object.registerClass("tentacle", TentacleClass);
#endinitclip
分享:和Flash初學(xué)者詳談Loading的制作首先說(shuō)一下為什么FLASH中要用Loading。所謂Loading,主要是指在網(wǎng)上觀看Flash時(shí),有時(shí)由于文件太大,或是網(wǎng)速限制,需要裝載一段時(shí)間才能播放,但由于這個(gè)Loadin
- as中禁用ESC鍵
- AS3.0 圖片變黑白 圖片彩色變黑白代碼
- flash as3.0 跨域的解決辦法
- 模板無(wú)憂(yōu)FLASH透明代碼
- Flash教你制作卡通MM眨眼睛動(dòng)畫(huà)
- Flash從零開(kāi)始學(xué)習(xí)創(chuàng)建單選按鈕
- Flash繪制小龍與花插畫(huà)場(chǎng)景
- Flash程序的測(cè)試方法
- Flash CS4文字顏色緩動(dòng)特效
- 網(wǎng)頁(yè)中演示類(lèi)FLASH動(dòng)畫(huà)制作規(guī)范
- Flash CS3循環(huán)背景的運(yùn)用技巧
- Flash鼠繪技巧教你制作紅綠色的樹(shù)葉
Flash教程Rss訂閱網(wǎng)站制作教程搜索
Flash教程推薦
- Flash教程:AS 3.0代碼實(shí)現(xiàn)甲蟲(chóng)跟隨鼠標(biāo)
- Flash MX2004入門(mén)與進(jìn)階實(shí)例——元件和實(shí)例(22)
- 代碼詳解attachMovie有區(qū)別的加載
- FLASH中純as的打字效果
- 用Flash AS制作逼真的下雨動(dòng)畫(huà)效果
- 土人AS入門(mén)教程基礎(chǔ)篇
- Flash制作超酷的旋轉(zhuǎn)圖像像冊(cè)視覺(jué)效果
- 再談?dòng)肍lash引導(dǎo)線(xiàn)制作愛(ài)心圖案動(dòng)畫(huà)
- Flash MX2004入門(mén)與進(jìn)階實(shí)例——元件和實(shí)例(9)
- 新手來(lái)看:Flahs as入門(mén)教程
- 相關(guān)鏈接:
- 教程說(shuō)明:
Flash教程-用Flash AS編寫(xiě)的蝌蚪特效動(dòng)畫(huà)
。