民浩

 

1046: 找不到类型,或者它不是编译时常数: Label 解决方案

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。
解决方法:
用flash开发工具(cs5)打开当前项目  ——> 窗口  ——>组件 ——>找到Label标签拖到舞台上面,然后再删除,问题就解决啦!

posted on 2011-06-12 03:42  民浩  阅读(5991)  评论(1编辑  收藏  举报

导航