2008年12月23日
初めてのWonderfl @ Flash
Wonderflに初投稿です。
Tweenerが使えると知ったので、Tweenerを使ってます。
作っている途中に複数のmovieclipにして、動きをonCompleteでループさせるようにしたのですが、その中でforループしては、不味い気がします。(^_^;)
間隔を短くして、ランダムにターゲットを選んだ方がよいのかも。<これはこれで問題がありそうだけど。
2008年12月24日追記
Tweener.isTweeningで判定してTween中のモノにaddTweenしない様にしました。
package{ import flash.display.MovieClip; import caurina.transitions.*; // import net.hires.debug.Stats; [SWF(frameRate="60")] public class Xyz extends MovieClip{ public var mc:MovieClip; public var mcArray:Array=new Array(); public var num:uint = 100; public function Xyz(){ for(var i:uint = 0;i< num;i++){ mc = new MovieClip(); mc.graphics.beginFill(Math.random() * 0xFFFFFF); mc.graphics.drawRect(0,0,18,32); this.addChild(mc); mcArray.push(mc); } for(var j:uint = 0;j< num;j++){ var targetMc:MovieClip = mcArray[j]; targetMc.x = Math.random()*stage.stageWidth; targetMc.y = Math.random()*stage.stageHeight; targetMc.rotation = Math.random()*360; } // addChild( new Stats() ); update(); } public function update():void { for(var i:uint = 0;i< num;i++){ var targetMc:MovieClip = mcArray[i]; if(!Tweener.isTweening(targetMc)){ Tweener.addTween(targetMc, { x:Math.random()*stage.stageWidth, y:Math.random()*stage.stageHeight, time:Math.random() *5+1, rotation:Math.random()*360, delay:Math.random()*2+1, onComplete:update, transition:"easeOutBounce"}); } } } } }
関連日記
- 2009年01月18日 wonderfl:3Dなパーティクル (6166)@ Flash
- 2009年08月09日 ブレッドボードでArduino (5059)@ 電子工作
- 2009年08月12日 Arduino Duemilanove 328が到着 (4526)@ 電子工作
- 2009年04月26日 wonderflのActionScriptをFlashで動かす (4360)@ Flash
- 2009年01月23日 wonderfl:MXML時のサムネイル画像 (3763)@ Flash
- 2009年04月26日 Flash/Flexの開発に必要な幾つか基本的なモノ (3729)@ Flash
- 2009年03月17日 Sandy FLARToolKit Starter Kit (3655)@ Flash
- 2008年12月18日 オンラインAS3コンパイラ「Wonderfl」 (3601)@ Flash
- 2009年12月16日 MacでFlash MiniBuilder (3557)@ Flash
- 2009年06月21日 wonderfl:フォークされるのは嬉しいが (3450)@ Flash
- 2009年06月09日 3Dなファーをレンダリング (3439)@ Flash
- 2009年02月24日 wonderfl:音声合成もどき (3306)@ Flash
- 2009年02月26日 Flash Player 10.0.22.87公開 (3180)@ Flash
- 2009年04月22日 wonderflに投稿されたコードのライセンス (3142)@ Flash
- 2008年12月25日 Wonderfl:MXML Test 2 (3090)@ Flash
- 2009年07月24日 physical x wonderfl (3087)@ Flash
- 2009年01月05日 Wonderfl:ランキング1位 (3040)@ Flash
- 2008年12月25日 Wonderfl:ユーザーランキング6位 (3025)@ Flash
- 2009年05月09日 wonderfl:BetweenAS3とjiglibflashに対応 (2984)@ Flash
- 2009年01月07日 Wonderfl:ランキングでまた1位 (2983)@ Flash
- 2010年10月29日 久々にwonderfl (2979)@ Flash
- 2008年12月27日 Wonderfl:ユーザーランキング2位 (2929)@ Flash
- 2008年12月24日 Wonderflの投稿二つ目 (2927)@ Flash
- 2009年01月24日 wonderfl:新しいランキングの仕組み (2921)@ Flash
- 2009年01月10日 wonderfl:3Dが色々 (2887)@ Flash
- 2009年01月25日 wonderfl:フルスクリーン対応 (2829)@ Flash
- 2010年01月22日 QuickBox2DとKitchenSync (2813)@ Flash
- 2009年01月12日 wonderfl:カメラの画像をミラー表示 (2743)@ Flash
- 2009年01月08日 wonderfl:ランキングの仕組み (2719)@ ウェブ
- 2009年04月28日 wonderfl:トップ10の半分がmatrix 5*5関連 (2682)@ Flash
アマゾン広告
この日記ページは閲覧数などの条件に応じて、閲覧制限を行っています。他からリンクしていただいても、そのリンクから辿った閲覧者が当ページの内容をご覧頂けない場合があります。ご了承下さい。