|

楼主 |
发表于 18-1-2005 09:54 PM
|
显示全部楼层
Can share out the coding..if can...will appreciate...thanks
前年写的东西。。。
- sh._visible=0;
- fw._visible=0;
- var maxfw=50;
- var bgwidth=550;
- var bgheight=400;
- var shindex=1;
- tx=new Array();ty=new Array();
- rx=new Array();ry=new Array();
- dx=new Array();dy=new Array();
- _root.stage.onRelease=function(){
- duplicateMovieClip(sh,"sh"+shindex,shindex);
-
- tx[shindex]=_root.stage._xmouse;
- ty[shindex]=_root.stage._ymouse;
-
- rx[shindex]=_root["sh"+shindex]._x-bgwidth/2;
- ry[shindex]=_root["sh"+shindex]._y-bgheight/2;
-
- dx[shindex]=(tx[shindex]-rx[shindex])/20;
- dy[shindex]=(ty[shindex]-ry[shindex])/20;
-
- _root["sh"+shindex]._rotation= -(Math.atan(dx[shindex]/dy[shindex])*180/Math.PI);
-
-
- shindex++; if (shindex>maxfw) shindex=1;
-
-
-
-
- }
- setInterval(moveshooter,25);
- function moveshooter(){
-
- for (i=1;i<=maxfw;i++){
-
- rx[i]=_root["sh"+i]._x-bgwidth/2;
- ry[i]=_root["sh"+i]._y-bgheight/2;
-
-
- if ( Math.pow(rx[i]-tx[i],2) >50 )
-
- _root["sh"+i]._x+=dx[i];
-
-
- if ( Math.pow(ry[i]-ty[i],2) >50 )
-
- _root["sh"+i]._y+=dy[i];
-
-
- else
- {
- removeMovieClip(_root["sh"+i]);
- createfirework(tx[i],ty[i],i)
- }
- }
- }
-
- //setInterval(createfirework,150,0,0,1);
-
- function createfirework(x,y,fwindex) {
-
- duplicateMovieClip(fw,"fw"+fwindex,fwindex);
- _root["fw"+fwindex]._x=x+bgwidth/2;
- _root["fw"+fwindex]._y=y+bgheight/2;
- _root["fw"+fwindex].gotoAndPlay(2);
-
-
-
-
- }
复制代码
还有那个firework mc 的最后一frame 要delete 掉自己。。'
[ Last edited by tensaix2j on 18-1-2005 at 10:03 PM ] |
|