Posted By

daisuke103 on 02/11/08


Tagged

image textmate mask load img Fuse as2 stage


Versions (?)

AS2 Fuseとマスクで雪崩のように画面遷移


 / Published in: Other
 

  1. /* ここから */
  2. //準備
  3. /*
  4. リンケージを貼ったシンボル"box"を用意
  5. インスタンス名pict_mcのMCを用意
  6.  
  7. Stage全体にcontainerを作りwhileでattach(画像の大きさ基準でもOK)
  8. 画像にcontainerのマスクをかけ、
  9. Fusekitを使ってランダムに消す
  10. 一番最後のboxが消えた時にdoCompleteで次の処理へ
  11. */
  12.  
  13. //--- src ---
  14. stop();
  15.  
  16. import com.mosesSupposes.fuse.*;
  17. import mx.transitions.easing.*;
  18. ZigoEngine.simpleSetup(Shortcuts);
  19.  
  20.  
  21. var container:MovieClip = this.createEmptyMovieClip("container",getNextHighestDepth());
  22. var m:Number =0;
  23. var count:Number=0;
  24. var mcy:Number = 0;
  25. var i:Number=0;
  26. while(mcy<Stage.height + mcy){
  27. this.container.attachMovie("box", "box"+i , this.container.getNextHighestDepth());
  28. var mc:MovieClip = this.container["box"+i];
  29. mc._x = mc._width * (count);
  30.  
  31. mc._y = mc._height * m;
  32. if (mc._x > Stage.width){
  33. count=0
  34. m++;
  35. }else{
  36. count++;
  37. }
  38. mcy = mc._y;
  39. i++;
  40.  
  41. // ここで消え方を調整
  42. if(mcy>=Stage.height){
  43. mc.scaleTo(0, 0, Elastic.easeOut, 0.005*i,"doComplete");
  44. break;
  45. }else{
  46. mc.scaleTo(0, 3, Elastic.easeOut, 0.005*Math.round(Math.random()*i));
  47. }
  48. }
  49. // 消す画像にマスクをかける
  50. this.pict_mc.setMask(container);
  51.  
  52. // 消した後の処理
  53. function doComplete(){
  54. trace("Complete");
  55. // 生成したマスクを消す
  56. //this.pict_mc.setMask(null);
  57. for(n=0;n<i;n++){
  58. //var mc:MovieClip = this.container["box"+n];
  59. //removeMovieClip(mc);
  60. }
  61. removeMovieClip(container);
  62. //_root.gotoAndPlay(1);
  63. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: daisuke103 on February 11, 2008
Posted By: daisuke103 on February 11, 2008

You need to login to post a comment.