我创建了一个文档类Main,并使用了
中的Adobe Sample代码http://help.adobe.com/en_US/as3/components/WS5b3ccc516d4fbf351e63e3d118a9c65b32-7f9f.html
我收到了错误:
1046: Type was not found or was not a compile-time constant: TextInput.
我不明白为什么:
包{
import flash.display.MovieClip;
import fl.controls.Label;
import fl.controls.TextInput;
public class Main extends MovieClip
{
public function Main()
{
var nameLabel:Label = new Label();
var nameTi:TextInput = new TextInput();
var tf:TextFormat = new TextFormat();
addChild(nameLabel);
addChild(nameTi);
nameTi.restrict = "A-Z .a-z";
tf.font = "Georgia";
tf.color = 0x0000CC;
tf.size = 16;
nameLabel.text = "Name: " ;
nameLabel.setSize(50, 25);
nameLabel.move(100,100);
nameLabel.setStyle("textFormat", tf);
nameTi.move(160, 100);
nameTi.setSize(200, 25);
nameTi.setStyle("textFormat", tf);
}
}
}