我試圖建立柔性純AS3的項目,我得到了以下錯誤:軟硬度:類型未找到或不是編譯時常:按鈕
type was not found or was not a compile-time constant: Button
type was not found or was not a compile-time constant: TextField
我的代碼是:
import fl.controls.TextInput; // import my textinput
import flash.display.Shape;
import flash.display.SimpleButton;
import flash.display.Sprite;
import flash.text.TextField;
import fl.controls.Button; //import my button
public class SearchYoutube extends Sprite
{
private var textBx:TextField=new TextField();
private var controls:Controls;
private var bground:Sprite=new Sprite();
private var searchButton:Button;
/************************Constructor*********************/
public function SearchYoutube()
{
/*********************Create Search Form****************************/
createSearchForm("Please Enter Your Keyword");
}
/*********************Search Form****************************/
private function createSearchForm(title:String):void{
var searchInput:TextInput = new TextInput(); //error here
searchInput.width = 200;
searchInput.x=150;
searchInput.y=450;
searchKeyword=searchInput.text;
addChild(searchInput);
searchButton = new Button(); //error here
searchButton.x = 380;
searchButton.y = 450;
searchButton.label = "Search";
addChild(searchButton);
}
}
}
我明白任何幫助!
是的,但是這打破了他創建一個純動作項目的目標,因爲mx的東西是flex框架的一部分:) – 2010-08-06 18:49:25
不是'純動作'意思是沒有mxml?你所說的是'純Flash',但那是不同的。 – Manius 2010-12-21 03:56:09