※現在、「wonderfl build flash online」求人コンテンツ制作に関してのアンケートを実施中です!みなさまのお力添えを頂いて、続々とアンケート結果が集まっていますが、まだまだ募集しております。ご協力のほど、どうぞよろしくお願いいたします!

wonderfl運営事務局
→アンケートページ(※ログインしてからお答えいただけるようになっています。)

 notice: Flash editor updated! Join the development! Thanks to MiniBuilder


FORKED
  1. // forked from mtok's Sample of ParticleField
  2. package  
  3. {
  4.     import flash.display.Sprite;
  5.     import flash.events.Event;
  6.     import flash.display.StageAlign;
  7.     import flash.display.StageScaleMode;
  8.     import org.papervision3d.core.view.IView;
  9.     import org.libspark.thread.Thread;
  10.     import org.libspark.thread.EnterFrameThreadExecutor;
  11.     /**
  12.      * ...
  13.      * @author ...
  14.      */
  15.     public class Pv3d011 extends Sprite
  16.     {
  17.         private var _view:CustomView;
  18.         public function Pv3d011() 
  19.         {
  20.             addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
  21.         }
  22.         
  23.         private function addedToStageHandler(e:Event):void 
  24.         {
  25.             //ステージを左上の隅に揃えるよう指定します。
  26.             stage.align = StageAlign.TOP_LEFT;
  27.             //Flash アプリケーションのサイズが固定され、Flash Player のウィンドウのサイズが変更された場合でも、サイズが維持されるように指定します。
  28.             stage.scaleMode = StageScaleMode.NO_SCALE;
  29.             //1秒あたりのフレーム数で表されます。
  30.             stage.frameRate = 30;
  31.             _view = new CustomView(); //下記関数を参考
  32.             addChild(_view);
  33.         }
  34.         
  35.     }
  36. }
  37. import flash.display.Bitmap;
  38. import flash.display.Sprite;
  39. import flash.display.BitmapData;
  40. import flash.display.Loader;
  41. import flash.events.Event;
  42. import flash.net.URLRequest;
  43. import flash.system.ApplicationDomain;
  44. import flash.system.LoaderContext;
  45. import org.papervision3d.view.BasicView;
  46. import org.papervision3d.objects.special.ParticleField;
  47. import org.papervision3d.materials.special.ParticleMaterial;
  48. internal class CustomView extends BasicView {
  49.     private var bmpData:BitmapData;
  50.     private var pf:ParticleField;
  51.     public function CustomView() {
  52.         super(00truetrue);
  53.         buildScene(); //下記関数を参考、パーティクルをsceneに配置
  54.         startRendering(); //レンダリング
  55.         addEventListener(Event.ENTER_FRAME, enterFrameHandler);
  56.     }
  57.     
  58.     private function enterFrameHandler(e:Event):void 
  59.     {
  60.         //下記で作成したパーティクル(四角形)を回転させている
  61.         pf.rotationX += 1;
  62.         pf.rotationY += 1;
  63.     }
  64.     
  65.     protected function buildScene():void {
  66.         
  67.         var mf:ParticleMaterial = new ParticleMaterial(0x0000ff, 1);
  68.         pf = new ParticleField(mf, 10005100010001000);
  69.         scene.addChild(pf);
  70.         
  71.         camera.x = 0;
  72.         camera.y = 0;
  73.         camera.z = -200;
  74.     }
  75. }
noswf
  1. // forked from mtok's Sample of ParticleField
  2. package  
  3. {
  4.     import flash.display.Sprite;
  5.     import flash.events.Event;
  6.     import flash.display.StageAlign;
  7.     import flash.display.StageScaleMode;
  8.     import org.papervision3d.core.view.IView;
  9.     import org.libspark.thread.Thread;
  10.     import org.libspark.thread.EnterFrameThreadExecutor;
  11.     /**
  12.      * ...
  13.      * @author ...
  14.      */
  15.     public class Pv3d011 extends Sprite
  16.     {
  17.         private var _view:CustomView;
  18.         public function Pv3d011() 
  19.         {
  20.             addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
  21.         }
  22.         
  23.         private function addedToStageHandler(e:Event):void 
  24.         {
  25.             stage.align = StageAlign.TOP_LEFT;
  26.             stage.scaleMode = StageScaleMode.NO_SCALE;
  27.             stage.frameRate = 30;
  28.             _view = new CustomView();
  29.             addChild(_view);
  30.         }
  31.         
  32.     }
  33. }
  34. import flash.display.Bitmap;
  35. import flash.display.Sprite;
  36. import flash.display.BitmapData;
  37. import flash.display.Loader;
  38. import flash.events.Event;
  39. import flash.net.URLRequest;
  40. import flash.system.ApplicationDomain;
  41. import flash.system.LoaderContext;
  42. import org.papervision3d.view.BasicView;
  43. import org.papervision3d.objects.special.ParticleField;
  44. import org.papervision3d.materials.special.ParticleMaterial;
  45. internal class CustomView extends BasicView {
  46.     private var bmpData:BitmapData;
  47.     private var pf:ParticleField;
  48.     public function CustomView() {
  49.         super(00truetrue);
  50.         buildScene();
  51.         startRendering();
  52.         addEventListener(Event.ENTER_FRAME, enterFrameHandler);
  53.     }
  54.     
  55.     private function enterFrameHandler(e:Event):void 
  56.     {
  57.         pf.rotationX += 1;
  58.         pf.rotationY += 1;
  59.     }
  60.     
  61.     protected function buildScene():void {
  62.         
  63.         var mf:ParticleMaterial = new ParticleMaterial(0x000000, 10);
  64.         pf = new ParticleField(mf, 1005100100100);
  65.         scene.addChild(pf);
  66.         
  67.         camera.x = 0;
  68.         camera.y = 0;
  69.         camera.z = -200;
  70.     }
  71. }
noswf
Get Adobe Flash Player