【问题标题】:Using cast3d in flash actionscript error:在 flash actionscript 中使用 cast3d 错误:
【发布时间】:2012-05-16 14:46:28
【问题描述】:

我是 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;
    }               
}
}

谁能告诉我代码有什么问题? 多谢 阿德里安

【问题讨论】:

    标签: flash


    【解决方案1】:

    此错误告诉您它找不到作为 cast3D 框架一部分的类 LoadEvent。我怀疑你没有包括包含类的 cast3D swc。

    可以从here - cast3D SWC下载

    如果您仍然有问题,那么您将如何包含它们的类,并且该方法取决于您使用的是 Flash IDE、Flash Develop 还是 Flash Builder。

    编辑:

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

    编辑 -> 首选项 -> Actionscript 3 -> 库路径 -> 浏览 SWC

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

    【讨论】:

    • 你能告诉我如何在 flash cs3 上安装一个 swc 吗?
    • 对迟到的回复感到抱歉。现在我安装了 .swc 它现在告诉我在 cast3D 操作脚本中的这些组件上出现相同的错误,例如在这个:public function get xnode(): DisplayObject3D { return _xnode; }
    猜你喜欢
    • 2013-01-23
    • 1970-01-01
    • 2010-10-21
    • 1970-01-01
    • 2011-02-04
    • 1970-01-01
    • 1970-01-01
    • 2010-10-28
    • 1970-01-01
    相关资源
    最近更新 更多