Saturday, January 10, 2009

Entry 23: Happy new year flash

HAPPY NEW YEAR
I designed this flash base on an online tutorial. It will show a fireworks when you click on the fash file. I will post the action script bellow so you can do it by yourself.




import flash.display.BitmapData;

onMouseUp=createMainDot;

currentAmount=0;
maxAmount=400

maxChildNum=7


_root.createEmptyMovieClip("holder",100);
_root.holder.createEmptyMovieClip("core",100);


function createMainDot(){
dot=_root.holder.core.attachMovie("dot","dot"+_root.getNextHighestDepth(),_root.getNextHighestDepth()+random(1000));
dot._x=_xmouse;
dot._y=_ymouse;
dot.childNum=maxChildNum;

dot.y=_ymouse;

dot.onEnterFrame=function(){
this._y+=(this.y-350-this._y)/5
if (Math.abs(this._y-this.y+350)<5){ i="0;iStage.height-40){
for (i=0;i
createDot(this._x,this._y,this.childNum-1,this.fallSpeed/3)
}
this.removeMovieClip();
currentAmount--;
}

}
}

}

bmp= new BitmapData(Stage.width,Stage.height,true,0);

_root.createEmptyMovieClip("canvas",0);

canvas.attachBitmap(bmp,0);

import flash.filters.BevelFilter;

bg.core._alpha=5;
canvas.onEnterFrame=function(){
holder.core._alpha=12;
bmp.draw(holder);
holder.core._alpha=100;
bg._alpha=100;
bmp.draw(bg);
}

sign.swapDepths(this.getNextHighestDepth())




No comments: