我认为我的代码没问题,但由于一些奇怪的原因,它无法正常工作。 我是这个AS3的新手,但我尽力让它发挥作用。
package {
import flash.display.MovieClip;
import flash.display.Stage;
import flash.display.NativeMenu;
import flash.display.NativeMenuItem;
import flash.display.NativeWindow;
import flash.events.MouseEvent;
import flash.events.KeyboardEvent;
import flash.events.AccelerometerEvent;
import flash.events.TimerEvent;
import flash.ui.Keyboard;
import flash.ui.Multitouch;
import flash.ui.MultitouchInputMode;
import flash.system.System;
import flash.desktop.SystemIdleMode;
import flash.sensors.Accelerometer;
import flash.utils.Timer;
public class Shooter extends MovieClip {
private var welcomeScreenMC: Welcome = new Welcome();
public function Shooter() {
// constructor code
stage.addChild(welcomeScreenMC);
welcomeScreenMC.x = stage.stageWidth / 2;
welcomeScreenMC.y = stage.stageHeight / 2;
welcomeScreenMC.buttonMC.addEventListener(MouseEvent.CLICK, playWithTouch);
}
}
}