我已经被这样的错误困住了 2 天了,但是我从以前关于这个错误的问题的数量中搜索解决这个问题,我似乎仍然无法让它工作,主要是因为我没有完全理解它。
这是我的代码:
package {
import flash.events.*;
import flash.display.MovieClip;
import flash.events.MouseEvent;
import org.libspark.flartoolkit.support.pv3d.FLARBaseNode;
import org.papervision3d.objects.parsers.DAE;
import org.papervision3d.lights.PointLight3D;
import org.papervision3d.materials.shadematerials.FlatShadeMaterial;
import org.papervision3d.materials.utils.MaterialsList;
import org.papervision3d.objects.primitives.Cone;
import org.papervision3d.objects.primitives.Plane;
import org.papervision3d.materials.MovieAssetMaterial;
import org.papervision3d.events.FileLoadEvent;
import org.papervision3d.objects.DisplayObject3D;
import org.papervision3d.core.proto.MaterialObject3D;
import org.papervision3d.objects.primitives.Cube;
[SWF(width=640, height=530, backgroundColor=0x808080, frameRate=30)]
public class Earth extends PV3DARApp {
private var _earth:DAE;
private var _teapot:DAE;
private var _bone:DAE;
protected var _baseNode:FLARBaseNode
public function Earth() {
addEventListener(Event.INIT, _onInit);
init('Data/camera_para.dat', 'Data/paris.pat');
}
private function _onInit(e:Event):void {
bulet.addEventListener(MouseEvent.CLICK, _tombolbulet);
teapot.addEventListener(MouseEvent.CLICK, _tombolteapot);
tulang.addEventListener(MouseEvent.CLICK, _tomboltulang);
addChild(bulet);
addChild(teapot);
addChild(tulang);
_earth = new DAE();
_earth.load('model/earth.dae');
_earth.scale = 10;
_earth.rotationX = 90;
//_markerNode.addChild(_earth);
_teapot = new DAE();
_teapot.load('model/teapot.DAE');
_teapot.scale = 10;
_teapot.rotationX = 90;
//_markerNode.addChild(_teapot);
_bone = new DAE();
_bone.load('model/bone.DAE');
_bone.scale = 10;
_bone.rotationX = 90;
//_markerNode.addChild(_bone);
function _tombolbulet (event:MouseEvent):void
{
remove_all();
_baseNode.addChild(_earth);
}
function _tombolteapot (event:MouseEvent):void
{
remove_all();
_baseNode.addChild(_teapot);
}
function _tomboltulang (event:MouseEvent):void
{
remove_all();
_baseNode.addChild(_bone);
}
function remove_all () : void
{
_baseNode.removeChild(_earth);
_baseNode.removeChild(_teapot);
_baseNode.removeChild(_bone);
}
//addEventListener(Event.ENTER_FRAME, _update);
}
/*private function _update(e:Event):void {
_earth.rotationZ += 0.5
_teapot.rotationZ += 0.5
_bone.rotationZ += 0.5
}*/
}
}