作者zswolf (响彻云霄的喇叭声)
看板Flash
标题Re: [问题] 请问onClipEvent..
时间Fri Aug 28 14:59:51 2009
改好的档案
http://www.ac-momo.com/download/snowfix.rar
希望对你有帮助:)
记得研究为什麽要这样写,才会有进步的:))))
stop();
var snowNum:Number = 1;
snow_all.snow._visible = false;
function getSnow() {
duplicateMovieClip(snow_all.snow, "snow"+snowNum,
snow_all.getNextHighestDepth());
snow_all['snow'+snowNum]._visible=false
snow_all['snow'+snowNum]._x = Math.random(1)*600;
snow_all['snow'+snowNum]._y = Math.random(1)*20;
snow_all['snow'+snowNum]._alpha = Math.random(1)*150;
snow_all['snow'+snowNum].angle = Math.random(1)*24+3;
snow_all['snow'+snowNum].speed = Math.random(1)*3+1;
snow_all['snow'+snowNum].size = Math.random(1)*100;
snow_all['snow'+snowNum]._visible=true
snow_all['snow'+snowNum].onEnterFrame = function() {
this._y += this.speed;
this._rotation += this.angle;
this._xscale = this._yscale=this.size;
if (this._y>=360) {
delete this.onEnterFrame;
this.removeMovieClip();
}
};
clearInterval(interSnow)
interSnow=setInterval(getSnow,random(1000))
snowNum++
}
getSnow()
var interSnow:Number=setInterval(getSnow,1000)
※ 引述《cadmus22 (mdn头家)》之铭言:
: 刚刚照范例做了练习,
: 雪花会飘动落下..
: 但只限於他的范例档案
: 另外一个我自己做的..本来照着书上打程式码
: 後来一直无法动作
: 就把范例一起来对照
: 但是我自己做的怎麽都不会动
: 把自己做的元件贴在范例里面.就会动了
: 可是我一直不知道问题在哪
: 附上档案http://twirl.at/0Du
: 002是范例档
: 003是我自己做的练习
--
挖~~店员辞职啦~~~~
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.133.27.234
1F:推 cjcat2266:超热心! 08/28 15:17
2F:推 cadmus22:含泪感谢中...>"< 08/28 15:23
3F:推 aquarianboy:是好人! :) 08/28 15:57