flash on 2011-6-9
/**
* Copyright zahir ( http://wonderfl.net/user/zahir )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/vQU4
*/
package {
import flash.display.Sprite;
public class FlashTest extends Sprite {
public function FlashTest() {
// write as3 code here..
var round:int = 0;
for(var i:int = 0; i < 5; i++)
{
for(var j:int = 0; j<5; j++)
{
round++;
var r:RoundRect = new RoundRect( 50, round );
r.x = j * 65 + 15;
r.y = i * 75 + 15;
addChild( r );
}
}
}
}
}
import flash.text.TextField;
import flash.display.Sprite;
class RoundRect extends Sprite
{
public function RoundRect( size:int, r:int )
{
var t:TextField = new TextField();
addChild(t);
t.autoSize = "left";
t.text = r.toString() + " px";
t.x = (size - t.width) / 2;
graphics.beginFill(0);
graphics.drawRoundRect( 0, t.height, size, size, r,r );
graphics.endFill();
}
}