[英]Why not importing the this class? AS3
我嘗試按照本教程
這是我的代碼:
import flash.display.Sprite;
import flash.events.Event;
import flash.display.ShaderInput;
import flash.events.KeyboardEvent;
import Input; //here is a problem
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point
square = new Sprite();
square.graphics.beginFill(0x333333);
square.graphics.drawRect(0, 0, 30, 30);
square.x = stage.stageWidth / 2 - square.width / 2;
square.y = stage.stageHeight / 2 - square.height / 2;
addChild(square);
Input.initialize(stage); //here is another problem
//Add the refresh loop
addEventListener(Event.ENTER_FRAME, refresh);
}
private function refresh(e:Event):void {
trace("gigi");
}
我收到此錯誤:
Line 42 1120: Access of undefined property Input.
Line 7 1172: Definition Input could not be found.
有誰知道為什么會發生此錯誤? 無法導入類教程輸入,但已使用。
提前致謝!
在本教程中,有一個“下載附件”按鈕,用於下載包含Input類的ZIP。 將此添加到您的src文件夾。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.