+ -
当前位置:首页 → 问答吧 → 明明已经导入了flash.display.MovieClip fl.controls.Label fl.controls.TextInput等控件却还是报错

明明已经导入了flash.display.MovieClip fl.controls.Label fl.controls.TextInput等控件却还是报错

时间:2009-04-20

来源:互联网

package
{
import flash.display.MovieClip;
import fl.controls.Label;
import fl.controls.TextInput;
import fl.controls.Button;
import flash.events.MouseEvent;

public class Login extends MovieClip
{
public function Login()
{
var User_Label:Label = new Label();
User_Label.text = "用户名称:";
User_Label.x = 100;
User_Label.y=100;

var User_Text:TextInput = new TextInput();
User_Text.x = 180;
User_Text.y = 100;

var Pwd_Label:Label = new Label();
Pwd_Label.text = "用户密码:";
Pwd_Label.x = 100;
Pwd_Label.y = 120;

var Pwd_Text:TextInput = new TextInput();
Pwd_Text.displayAsPassword = true;
Pwd_Text.x = 180;
Pwd_Label.y = 120;

var Btn_Button:Button = new Button();
Btn_Button.label = "登陆";
Btn_Button.x = 140;
Btn_Button.y = 140;
Btn_Button.addEventListener(MouseEvent.CLICK,Btn_Click);

this.addChild(User_Label);
this.addChild(User_Text);
this.addChild(Pwd_Label);
this.addChild(Pwd_Text);
this.addChild(Btn_Button);
}
private function Btn_Click(e:MouseEvent):void
{

}

}
}
1046: 找不到类型,或者它不是编译时常数: Label。
1046: 找不到类型,或者它不是编译时常数: TextInput。
1046: 找不到类型,或者它不是编译时常数: Label。
1046: 找不到类型,或者它不是编译时常数: TextInput。
1046: 找不到类型,或者它不是编译时常数: Button。
1180: 调用的方法 Label 可能未定义。
1180: 调用的方法 TextInput 可能未定义。
1180: 调用的方法 Label 可能未定义。
1180: 调用的方法 TextInput 可能未定义。
1172: 找不到定义 fl.controls:Label。
1172: 找不到定义 fl.controls:TextInput。
1172: 找不到定义 fl.controls:Button。

作者: thekingofblacksun   发布时间: 2009-04-20

楼主这个问题解决了么?
怎么解决的?

作者: fuqd273   发布时间: 2009-06-08

需要拖拽任何一个UI控件到库里,或者舞台。 应该就可以了

作者: ahuikoo   发布时间: 2011-07-02