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なパーティクル (6305)@ Flash
- 2009年08月09日 ブレッドボードでArduino (5195)@ 電子工作
- 2009年08月12日 Arduino Duemilanove 328が到着 (4617)@ 電子工作
- 2009年04月26日 wonderflのActionScriptをFlashで動かす (4460)@ Flash
- 2009年01月23日 wonderfl:MXML時のサムネイル画像 (3873)@ Flash
- 2009年04月26日 Flash/Flexの開発に必要な幾つか基本的なモノ (3839)@ Flash
- 2009年03月17日 Sandy FLARToolKit Starter Kit (3782)@ Flash
- 2008年12月18日 オンラインAS3コンパイラ「Wonderfl」 (3716)@ Flash
- 2009年12月16日 MacでFlash MiniBuilder (3651)@ Flash
- 2009年06月21日 wonderfl:フォークされるのは嬉しいが (3547)@ Flash
- 2009年06月09日 3Dなファーをレンダリング (3546)@ Flash
- 2009年02月24日 wonderfl:音声合成もどき (3409)@ Flash
- 2009年02月26日 Flash Player 10.0.22.87公開 (3326)@ Flash
- 2009年04月22日 wonderflに投稿されたコードのライセンス (3224)@ Flash
- 2009年07月24日 physical x wonderfl (3172)@ Flash
- 2008年12月25日 Wonderfl:MXML Test 2 (3168)@ Flash
- 2009年01月05日 Wonderfl:ランキング1位 (3131)@ Flash
- 2008年12月25日 Wonderfl:ユーザーランキング6位 (3124)@ Flash
- 2009年01月07日 Wonderfl:ランキングでまた1位 (3107)@ Flash
- 2009年05月09日 wonderfl:BetweenAS3とjiglibflashに対応 (3081)@ Flash
- 2010年10月29日 久々にwonderfl (3072)@ Flash
- 2008年12月27日 Wonderfl:ユーザーランキング2位 (3067)@ Flash
- 2008年12月24日 Wonderflの投稿二つ目 (3039)@ Flash
- 2009年01月24日 wonderfl:新しいランキングの仕組み (3012)@ Flash
- 2009年01月10日 wonderfl:3Dが色々 (2981)@ Flash
- 2009年01月25日 wonderfl:フルスクリーン対応 (2914)@ Flash
- 2010年01月22日 QuickBox2DとKitchenSync (2896)@ Flash
- 2009年01月12日 wonderfl:カメラの画像をミラー表示 (2855)@ Flash
- 2009年01月08日 wonderfl:ランキングの仕組み (2816)@ ウェブ
- 2009年01月26日 第9回「Webさわり会議」でした (2773)@ 広島
アマゾン広告
この日記ページは閲覧数などの条件に応じて、閲覧制限を行っています。他からリンクしていただいても、そのリンクから辿った閲覧者が当ページの内容をご覧頂けない場合があります。ご了承下さい。
