在flash actionscript错误中使用cast3d:

时间:2012-05-16 14:46:29

标签: flash

我是Flash的新手,我正在尝试将模型放到网上,并尝试使用cast3D框架工作。当我尝试第一个教程时,出现了这个错误 :" 1046:未找到类型或不是编译时常量:LoadEvent。"发生错误的代码区:

private function cast3dLoadComplete(event: LoadEvent): void
    {
        trace("cast3dLoadComplete ");
        this.manipulator = new TrackBall(this.animator,this.stage,
                                 this.stage.stageWidth, this.stage.stageHeight,
                                 Manipulator.Y_UP);
                       this.loaded = true;
                       removeTimer();                                   
                      if (loader.loaderror.length)
                      {
            statusText.textColor = 0xff0000;                                
            statusText.text = loader.loaderror;            
                       }
                      else
                      {                                 
            statusText.visible = false;
                      }
    }

    /**
     * Handles the load Error event
     */     
    private function cast3dLoadError(event: LoadEvent): void
    {
        trace("cast3dLoadError ", event.message );
                    removeTimer();
        statusText.textColor = 0xff0000;                                
        statusText.text = event.message;
    }               
}
}

有人能告诉我代码有什么问题吗? 非常感谢 阿德里安

1 个答案:

答案 0 :(得分:0)

此错误告诉您它无法找到属于cast3D框架的类LoadEvent。我怀疑你不包括包含类的cast3D swc。

可以从here - cast3D SWC

下载

如果您仍有问题,那么您将如何包含其类,并且该方法取决于您是否使用Flash IDE,Flash Develop或Flash Builder。

修改

我使用CS5但在CS3上应该类似,请转到菜单:

  

编辑 - >偏好 - > Actionscript 3 - >库路径 - >浏览SWC

应该看到与下面这个类似的面板!

enter image description here