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なパーティクル (6043)@ Flash
- 2009年08月09日 ブレッドボードでArduino (4976)@ 電子工作
- 2009年08月12日 Arduino Duemilanove 328が到着 (4437)@ 電子工作
- 2009年04月26日 wonderflのActionScriptをFlashで動かす (4257)@ Flash
- 2009年01月23日 wonderfl:MXML時のサムネイル画像 (3647)@ Flash
- 2009年04月26日 Flash/Flexの開発に必要な幾つか基本的なモノ (3628)@ Flash
- 2009年03月17日 Sandy FLARToolKit Starter Kit (3549)@ Flash
- 2008年12月18日 オンラインAS3コンパイラ「Wonderfl」 (3490)@ Flash
- 2009年12月16日 MacでFlash MiniBuilder (3455)@ Flash
- 2009年06月21日 wonderfl:フォークされるのは嬉しいが (3354)@ Flash
- 2009年06月09日 3Dなファーをレンダリング (3337)@ Flash
- 2009年02月24日 wonderfl:音声合成もどき (3209)@ Flash
- 2009年02月26日 Flash Player 10.0.22.87公開 (3086)@ Flash
- 2009年04月22日 wonderflに投稿されたコードのライセンス (3072)@ Flash
- 2009年07月24日 physical x wonderfl (3006)@ Flash
- 2008年12月25日 Wonderfl:MXML Test 2 (2998)@ Flash
- 2009年01月05日 Wonderfl:ランキング1位 (2943)@ Flash
- 2008年12月25日 Wonderfl:ユーザーランキング6位 (2934)@ Flash
- 2009年01月07日 Wonderfl:ランキングでまた1位 (2898)@ Flash
- 2009年05月09日 wonderfl:BetweenAS3とjiglibflashに対応 (2888)@ Flash
- 2010年10月29日 久々にwonderfl (2876)@ Flash
- 2009年01月24日 wonderfl:新しいランキングの仕組み (2843)@ Flash
- 2008年12月27日 Wonderfl:ユーザーランキング2位 (2835)@ Flash
- 2008年12月24日 Wonderflの投稿二つ目 (2830)@ Flash
- 2009年01月10日 wonderfl:3Dが色々 (2791)@ Flash
- 2009年01月25日 wonderfl:フルスクリーン対応 (2741)@ Flash
- 2010年01月22日 QuickBox2DとKitchenSync (2738)@ Flash
- 2009年01月12日 wonderfl:カメラの画像をミラー表示 (2670)@ Flash
- 2009年01月08日 wonderfl:ランキングの仕組み (2619)@ ウェブ
- 2009年01月26日 第9回「Webさわり会議」でした (2585)@ 広島
アマゾン広告
この日記ページは閲覧数などの条件に応じて、閲覧制限を行っています。他からリンクしていただいても、そのリンクから辿った閲覧者が当ページの内容をご覧頂けない場合があります。ご了承下さい。