我安装网上步骤装了egret,装了webstorm8.0。然后用egret新建了helloegret工程,用webstorm打开工程,然后新建demon.ts文件,复制代码。然后出错了……
demon.ts(4,21): error TS2304: Cannot find name 'egret'.
复制的代码贴下
class Demon extends egret.DisplayObjectContainer {
/**构造函数*/
public constructor() {
super();
this.addEventListener(egret.Event.ADDED_TO_STAGE,this.startGame,this);
}
/**游戏启动后,会自动执行此方法*/
public startGame():void {
alert("hello!");
}
}