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年06月09日 3Dなファーをレンダリング (6898)@ Flash
- 2009年01月18日 wonderfl:3Dなパーティクル (6433)@ Flash
- 2009年08月09日 ブレッドボードでArduino (5325)@ 電子工作
- 2009年08月12日 Arduino Duemilanove 328が到着 (4737)@ 電子工作
- 2009年04月26日 wonderflのActionScriptをFlashで動かす (4586)@ Flash
- 2009年01月23日 wonderfl:MXML時のサムネイル画像 (3999)@ Flash
- 2009年04月26日 Flash/Flexの開発に必要な幾つか基本的なモノ (3980)@ Flash
- 2009年03月17日 Sandy FLARToolKit Starter Kit (3963)@ Flash
- 2008年12月18日 オンラインAS3コンパイラ「Wonderfl」 (3848)@ Flash
- 2009年12月16日 MacでFlash MiniBuilder (3784)@ Flash
- 2009年06月21日 wonderfl:フォークされるのは嬉しいが (3685)@ Flash
- 2009年02月24日 wonderfl:音声合成もどき (3531)@ Flash
- 2009年02月26日 Flash Player 10.0.22.87公開 (3467)@ Flash
- 2009年04月22日 wonderflに投稿されたコードのライセンス (3386)@ Flash
- 2009年07月24日 physical x wonderfl (3301)@ Flash
- 2008年12月25日 Wonderfl:MXML Test 2 (3296)@ Flash
- 2009年01月05日 Wonderfl:ランキング1位 (3254)@ Flash
- 2008年12月25日 Wonderfl:ユーザーランキング6位 (3243)@ Flash
- 2009年05月09日 wonderfl:BetweenAS3とjiglibflashに対応 (3235)@ Flash
- 2010年10月29日 久々にwonderfl (3234)@ Flash
- 2009年01月07日 Wonderfl:ランキングでまた1位 (3223)@ Flash
- 2008年12月27日 Wonderfl:ユーザーランキング2位 (3190)@ Flash
- 2008年12月24日 Wonderflの投稿二つ目 (3168)@ Flash
- 2009年01月24日 wonderfl:新しいランキングの仕組み (3147)@ Flash
- 2009年01月10日 wonderfl:3Dが色々 (3104)@ Flash
- 2009年01月25日 wonderfl:フルスクリーン対応 (3038)@ Flash
- 2010年01月22日 QuickBox2DとKitchenSync (3016)@ Flash
- 2009年01月12日 wonderfl:カメラの画像をミラー表示 (2979)@ Flash
- 2009年01月08日 wonderfl:ランキングの仕組み (2927)@ ウェブ
- 2009年04月28日 wonderfl:トップ10の半分がmatrix 5*5関連 (2902)@ Flash
アマゾン広告
この日記ページは閲覧数などの条件に応じて、閲覧制限を行っています。他からリンクしていただいても、そのリンクから辿った閲覧者が当ページの内容をご覧頂けない場合があります。ご了承下さい。
