我的项目中出现此错误,我不知道如何修复它,我以前没见过:
位于flex2.compiler.as3.As3Compiler.analyze3(As3Compiler.java:701)的macromedia.asc.semantics.ConstantEvaluator.PreprocessDefinitionTypeInfo(ConstantEvaluator.java:3265)中的java.lang.NullPointerException:1131:不能嵌套类。
答案 0 :(得分:0)
这是由以下语法错误引起的:
public function addDecorator( decorator:IDecorator, subDrawLayer:Sprite ) : void {
if (subDrawLayer==null) {
subDrawLayer:Sprite = new Sprite();
}
drawLayer.addChild(subDrawLayer);
decorators.push(decorator);
subDrawLayers[decorator] = subDrawLayer;
}
特别是这一行subDrawLayer:Sprite = new Sprite();
subDrawLayer变量类型被意外定义了两次;一旦在参数中,然后一次内联函数。它应该是subDrawLayer = new Sprite();