我对 actionscript 3.0 还很陌生,而且我不断收到上面的错误。我的代码是
stop();
Lamp.addEventListener(MouseEvent.CLICK,lookatlamp);
function lookatlamp(event:MouseEvent){
Dialogue.text = "It is a very bright lamp. It hurts your eyes.";
}
Room.addEventListener(MouseEvent.CLICK,standup);
function standup(event:MouseEvent){
gotoAndStop(2);
}
第 2 帧:
stop();
Table.addEventListener(MouseEvent.CLICK,lookatthetable);
function lookatthetable(event:MouseEvent){
gotoAndStop(4);
}
FirstDoor.addEventListener(MouseEvent.CLICK,gotonextroom);
function gotonextroom(event:MouseEvent){
gotoAndStop(3);
}
框架 3:
stop();
Inspctdr.addEventListener(MouseEvent.CLICK,lookatthedoor);
function lookatthedoor(event:MouseEvent){
Dialogue.text = "It is a metal door with a shiny silver handle.";
}
完整的错误是:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.text::TextField@119c83d1 to flash.display.MovieClip.
at flash.display::MovieClip/gotoAndStop()
at Untitled_fla::MainTimeline/standup()
和
TypeError: Error #1034: Type Coercion failed: cannot convert flash.text::TextField@119c8449 to flash.display.MovieClip.
at flash.display::MovieClip/gotoAndStop()
at Untitled_fla::MainTimeline/lookatthetable()
我做错了什么?