이 메시지가 손실됩니다. 나는Flash TypeError : 오류 # 1009 : null 개체 참조의 속성이나 메서드에 액세스 할 수 없습니다. - 문서 클래스에서 TLFTextField에 액세스 할 때
package {
import flash.display.*;
import fl.text.*;
import flash.text.*;
import flash.events.*;
import flash.net.*;
public class Main extends MovieClip {
private var _netConnection:NetConnection;
private var _responder:Responder;
/* some other public + private vars */
public function Main() {
init();
}
public function init(e:*=null):void {
_netConnection = new NetConnection();
_responder = new Responder(uponResult);
txt.text = "init()";
}
/* more functions */
}
}
내가 넣다 TLFTextField를이 아니었다 TXT를 txt.addEventListener(Event.ENTER_FRAME, init);
을 추가하는 시도 (액션이 아닌 IDE에서 추가)를 TypeError: Error #1009: Cannot access a property or method of a null object reference.
출력 메시지 내 문서 클래스가 무대에 간단한 텍스트 필드에 액세스하려고 처음받을 .. 거기 ... 시작 부분에 오류가 출력됩니다.
나는 바보 같은 느낌이 든다. 예후 의사는 무엇인가? JB
은 당신이 당신의'txt'를 초기화하는 방법과 위치에 따라 달라집니다. 그 코드를 게시 할 수 있습니까? –
txt는 actionscript가 아닌 Flash IDE를 통해 스테이지에 수동으로 추가됩니다. –
txt가 없으면 이벤트 리스너를 추가 할 수 없습니다 ... 문서 클래스 'Event.ADDED_TO_STAGE! – weltraumpirat