标签:as3.0为label添加背景色 label as3.0 textfield
package
{
import fl.controls.Label;
import fl.controls.TextInput;
import flash.display.Sprite;
import flash.events.Event;
[SWF(backgroundColor=‘0xFFFFFF‘,width=‘400‘,height=‘300‘,frameRate=‘29‘)]
public class Main extends Sprite
{
private var userNameInfo:Label;
public function Main()
{
this.init();
this.doDrawInit();
}
private function init():void {
this.userNameInfo = new Label();
this.userNameInfo.width = 80;
this.userNameInfo.height = 40;
this.userNameInfo.textField.background = true;
this.userNameInfo.textField.backgroundColor = 0xFF00FF;
}
private function doDrawInit():void {
this.addChild(this.userNameInfo);
}
}
}因为Label对象中包涵了textField属性,可以通过这个属性对象中的属性background及backgroundColor来设置Label对象的背景色。
标签:as3.0为label添加背景色 label as3.0 textfield
原文地址:http://quietnight.blog.51cto.com/7163892/1673460