選択肢用ボタン
♥0 |
Line 36 |
Modified 2011-03-14 00:37:38 |
MIT License
archived:2017-03-20 13:50:26
ActionScript3 source code
/**
* Copyright Nowloading_ ( http://wonderfl.net/user/Nowloading_ )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/w4Qv
*/
package{
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFormat;
public class Button extends Sprite{
public var bwidth:Number = 140;
public var bheight:Number = 60;
public var color:uint;
public var text:String;
private var tlabel:TextField;
public function Button(color:uint = 0xff9999 , text:String = "工事中"){
this.color = color;
this.text = text;
init();
}
public function init():void{
var lineColor:uint = color - 0x303030;
graphics.lineStyle(3,lineColor);
graphics.beginFill(color);
graphics.drawRoundRect(0,0,bwidth,bheight,20,20);
graphics.endFill();
tlabel = new TextField();
var format:TextFormat = new TextFormat();
format.color = color - 0x606060;
format.size = 30;
format.align = "center";
tlabel.defaultTextFormat = format;
addChild(tlabel);
tlabel.text = text;
tlabel.y = 15;
tlabel.width = 140;
tlabel.autoSize = "left";
tlabel.wordWrap = true;
}
}
}