Changeset 29 for Theme-2/nobu
- Timestamp:
- 02/29/08 13:39:02 (10 months ago)
- Files:
-
- Theme-2/nobu/slideshow.fla (modified) (previous)
- Theme-2/nobu/src/Application.as (modified) (1 diff)
- Theme-2/nobu/src/ApplicationThread.as (modified) (3 diffs)
- Theme-2/nobu/src/lib/cloud/CloudViewThread.as (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Theme-2/nobu/src/Application.as
r27 r29 5 5 package 6 6 { 7 // import flash default libraries.8 import flash.display.MovieClip; // fixed dependents.9 7 import flash.display.StageAlign; 10 8 import flash.display.StageScaleMode; 11 9 import flash.display.StageQuality; 12 10 import flash.events.Event; 13 // import local libraries.14 11 import lib.core.PassiveMovieClip; 15 // import external libraries.16 12 import org.libspark.thread.MasterThread; 17 13 18 14 /** 19 * 20 * 15 * ドキュメントクラス 21 16 **/ 22 17 public class Application extends PassiveMovieClip 23 18 { 24 19 /** 25 * 26 * 20 * マスタースレッドのインスタンス 27 21 **/ 28 22 private var _masterThread:MasterThread; 29 23 30 24 /** 31 * 32 * 25 * 初期化を行う 33 26 **/ 34 27 protected override function initialize():void 35 28 { 29 // stageの設定 36 30 stage.align = StageAlign.TOP_LEFT; 37 31 stage.quality = StageQuality.HIGH; 38 32 stage.scaleMode = StageScaleMode.NO_SCALE; 39 33 34 // マスタースレッドの生成 40 35 _masterThread = new MasterThread(new ApplicationThread(this)); 36 37 // イベントリスナーの登録 41 38 addEventListener(Event.ENTER_FRAME, loop, false, 0, true); 42 39 } 43 40 44 41 /** 42 * エンターフレーム処理 45 43 * 46 * 44 * @param evt イベント 47 45 **/ 48 46 private function loop(evt:Event):void 49 47 { 48 // スレッドを実行 50 49 _masterThread.executeActiveThreads(); 51 50 } Theme-2/nobu/src/ApplicationThread.as
r28 r29 5 5 package 6 6 { 7 // import flash default libraries.8 7 import flash.display.Bitmap; 9 8 import flash.net.URLRequest; 10 // import local libraries.11 9 import lib.cloud.CloudView; 12 10 import lib.loading.LoadingProgressView; 13 11 import lib.core.PassiveMovieClip; 14 // import external libraries.15 12 import org.libspark.display.LoaderThread; 16 13 import org.libspark.net.URLLoaderThread; 17 14 import org.libspark.thread.Thread; 18 import org.libspark.utils.concurrent.ParallelExecutor;15 //import org.libspark.utils.concurrent.ParallelExecutor; 19 16 import org.libspark.utils.concurrent.SerialExecutor; 20 17 21 18 /** 22 * 23 * 19 * 全体の動きを制御するクラス 24 20 **/ 25 21 internal class ApplicationThread extends Thread 26 22 { 27 23 /** 28 * 29 * 24 * Applicationのインスタンス 30 25 **/ 31 26 private var _view:Application; 32 27 33 28 /** 34 * 35 * 29 * CloudViewのインスタンス 36 30 **/ 37 31 private var _cloud:CloudView; 38 32 39 33 /** 40 * 41 * 34 * URLLoaderThreadのインスタンス(XMLロード用) 42 35 */ 43 36 private var _xmlLoadThread:URLLoaderThread; 44 37 45 38 /** 46 * 47 * 39 * SerialExecutorのインスタンス(画像ロード用) 48 40 **/ 49 //private var _imageLoadThread:ParallelExecutor;50 41 private var _imageLoadThread:SerialExecutor; 51 42 52 43 /** 44 * 初期化を行う 53 45 * 54 * 46 * @param p_view Applicationのインスタンス 55 47 **/ 56 48 public function ApplicationThread(p_view:Application) … … 58 50 _view = p_view; 59 51 } 60 52 53 /** 54 * スレッドの初期化を行う 55 **/ 61 56 protected override function initialize():void 62 57 { … … 100 95 } 101 96 _cloud = _view.addChild(new CloudView(d)) as CloudView; 102 /*103 var i:int, b:Bitmap, p:PassiveMovieClip;104 for (i = 0; i < _imageLoadThread.numThreads; i++)105 {106 b = LoaderThread(_imageLoadThread.getThreadAt(i)).loader.content as Bitmap;107 p = _view.addChildAt(new PassiveMovieClip({108 x: Math.random() * _view.stage.stageWidth,109 y: Math.random() * _view.stage.stageHeight,110 visible: false111 }), 0) as PassiveMovieClip;112 p.addChild(b);113 }114 */115 97 } 116 98 Theme-2/nobu/src/lib/cloud/CloudViewThread.as
r28 r29 18 18 19 19 /** 20 * 21 * 20 * Papervision3Dの設定と管理を行うクラス 22 21 **/ 23 22 internal class CloudViewThread extends Thread 24 23 { 25 24 /** 26 * 27 * 25 * 空間の大きさ 26 */ 27 public static const SPACE_SIZE:int = 2000; 28 29 /** 30 * 回転率のリミット 31 */ 32 public static const ROTATION_LIMIT:int = 360; 33 34 /** 35 * ビュークラスのインスタンス 28 36 **/ 29 37 private var _view:CloudView; 30 38 31 39 /** 32 * 33 * 40 * シーンのインスタンス(papervision3d) 34 41 **/ 35 42 private var _scene:MovieScene3D; 36 43 37 44 /** 38 * 39 * 45 * カメラのインスタンス(papervision3d) 40 46 **/ 41 47 private var _camera:Camera3D; 42 48 43 49 /** 44 * 45 * 50 * 表示データの個数 46 51 **/ 47 52 private var _length:int; 48 53 49 54 /** 50 * 51 * 55 * 表示データのホルダー 52 56 **/ 53 57 private var _planes:Dictionary; … … 55 59 /** 56 60 * 61 * 初期化とレンダリング準備を行う 57 62 * 63 * @param p_view CloudViewのインスタンス 58 64 **/ 59 65 public function CloudViewThread(p_view:CloudView) … … 67 73 68 74 /** 69 * 70 * 75 * スレッドの初期化を行う 71 76 **/ 72 77 protected override function initialize():void … … 81 86 82 87 /** 83 * 84 * 88 * オブジェクトの生成と描画の更新を行う 85 89 **/ 86 90 protected override function execute():void … … 116 120 _scene.renderCamera(_camera); 117 121 } 118 122 123 /** 124 * ビットマップからオブジェクトを生成する 125 **/ 119 126 private function createPartial():void 120 127 { … … 126 133 var plane:Plane = new Plane(material, 0.5, 0, 2, 2); 127 134 var goData:DisplayObject3D = new DisplayObject3D(); 128 goData.x = Math.random() * 2000 - 1000;129 goData.y = Math.random() * 2000 - 1000;130 goData.z = Math.random() * 2000 - 1000;131 goData.rotationX = Math.random() * 360;132 goData.rotationY = Math.random() * 360;133 goData.rotationZ = Math.random() * 360;135 goData.x = Math.random() * SPACE_SIZE - SPACE_SIZE / 2; 136 goData.y = Math.random() * SPACE_SIZE - SPACE_SIZE / 2; 137 goData.z = Math.random() * SPACE_SIZE - SPACE_SIZE / 2; 138 goData.rotationX = Math.random() * ROTATION_LIMIT; 139 goData.rotationY = Math.random() * ROTATION_LIMIT; 140 goData.rotationZ = Math.random() * ROTATION_LIMIT; 134 141 plane.extra = { 135 142 goto: goData … … 147 154 148 155 /** 156 * オブジェクトのロールオーバー処理 149 157 * 150 * 158 * @param evt マウスイベント 151 159 **/ 152 160 private function rollOverListener(evt:MouseEvent):void 153 161 { 154 var plane:Plane = _planes[evt.target]; 155 plane.scaleX = 1.1; 156 plane.scaleY = 1.1; 157 plane.material.lineAlpha = 1; 162 _planes[evt.target].material.lineAlpha = 1; 158 163 } 159 164 160 165 /** 166 * オブジェクトのロールアウト処理 161 167 * 162 * 168 * @param evt マウスイベント 163 169 **/ 164 170 private function rollOutListener(evt:MouseEvent):void 165 171 { 166 var plane:Plane = _planes[evt.target]; 167 plane.scaleX = 1; 168 plane.scaleY = 1; 169 plane.material.lineAlpha = 0; 172 _planes[evt.target].material.lineAlpha = 0; 170 173 } 171 174 172 175 /** 176 * オブジェクトのマウスダウン処理 173 177 * 174 * 178 * @param evt マウスイベント 175 179 **/ 176 180 private function mouseDownListener(evt:MouseEvent):void 177 181 { 178 182 var plane:Plane = _planes[evt.target]; 179 plane.scaleX = 1;180 plane.scaleY = 1;181 183 plane.material.lineAlpha = 0; 182 184 … … 188 190 _camera.extra.goTarget.copyPosition(plane); 189 191 } 190 191 /**192 *193 *194 **/195 protected override function finalize():void196 {197 198 }199 192 } 200 193 }
