forked from: 勉強:クラスでボール表示
♥0 |
Line 19 |
Modified 2014-02-02 19:57:37 |
MIT License
archived:2017-03-20 10:27:11
ActionScript3 source code
/**
* Copyright aiz ( http://wonderfl.net/user/aiz )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/xBd5
*/
// forked from chuson83's 勉強:クラスでボール表示
package {
import flash.display.Sprite;
public class main extends Sprite {
public function main() {
var ball:Sprite = new BallSprite( 0xff00ff );//BallSpriteクラスのインスタンスを生成して表示
addChild( ball );
}
}
}
/*
ballを表示するクラス
*/
import flash.display.Sprite;
class BallSprite extends Sprite {
public function BallSprite( color:uint ) {
super();
graphics.beginFill(color);
graphics.drawCircle( 0, 0, 20 );
graphics.endFill();
}
}
/*
動くball
*/
import flash.events.*