flash on 2011-5-18
練習中
♥0 |
Line 27 |
Modified 2011-05-19 15:22:04 |
MIT License
archived:2017-03-20 04:34:04
ActionScript3 source code
/**
* Copyright shoco ( http://wonderfl.net/user/shoco )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/qnri
*/
package {
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.Event;
import caurina.transitions.*;
[SWF(width="465", height="465", backgroundColor="#ccffff", frameRate="60")]
//SWF ステージの幅 高さ 色 フレームレート
public class FlashTest extends Sprite { //クラス 最初のテスト 加えて スプライト(図形)
private var sp:Sprite; //このクラスのみで使える形式-spは、図形である
public function FlashTest() { //どこでも使える 処理 最初のテスト
init(); //init実行
}
private function init():void { //ここのみで使える形式
for(var i:int = 1; i<=30; i++) { // iは、整数であり、20以下であり、1つずつ増える 繰り返し
sp = new Sprite(); //spの新しい図形を作る
sp.graphics.beginFill(Math.random()*0xffffff); //spの面の色の指定 ランダム
sp.graphics.drawRoundRect(-30,-30,60,60,1,1); // アンカーポイントからの位置?の指定(x,y,大きさ)
sp.graphics.endFill(); //spの図形の設定を終了
sp.x = Math.random()*stage.stageWidth; //spのx方向をステージの横幅の中でランダムに表示
sp.y = Math.random()*stage.stageHeight; //spのy方向をステージの横幅の中でランダムに表示
sp.alpha = 0; //spのアルdrawRoundRectファ(不透明度)の指定
Tweener.addTween(sp, {rotation:-90,scaleX:Math.random()*10, scaleY:Math.random()*10, time:4, delay:0.4*i, alpha:Math.random(), transition:"easeInExpo"});
//spの出現する動作のスピード(Tweener) sp(指定した図形) スケールXY?大きさ? 出てくる時間 間隔?0.4×i秒 不透明度ランダム 出現タイプ?
addChild(sp); //配置する
}
}
}
}