intente con las variables seguir=false; y segui = false; pero no funciona
agradeseria su ayuda
gracias
Código ActionScript :
import flare.basic.*; import flare.core.*; import flare.system.*; import flare.utils.*; import flare.basic.Scene3D; import flare.basic.Viewer3D; import flash.events.Event; import flare.core.Mesh3D; import flare.events.MouseEvent3D; import flash.net.URLRequest; import flare.basic.*; import flare.core.*; import flare.system.*; import flare.utils.*; import flash.events.*; import flash.display.*; import flash.geom.*; import flare.basic.*; import flare.core.*; import flare.system.*; import flare.utils.*; var scene:Scene3D; var obj:Pivot3D; var seguir:Boolean; var segui:Boolean; var rotationAngleH:Number = 50; var rotationAngleV:Number = 40; var zDistancia:Number = 400; var Cylinder01:Mesh3D; var Box01:Mesh3D; scene = new Scene3D(this) scene = new Viewer3D(this) obj = scene.addChildFromFile("pyramid1..zf3d"); scene.addEventListener(Scene3D.COMPLETE_EVENT, Finalización); function Finalización(e:Event):void{ e.target.removeEventListener(Scene3D.COMPLETE_EVENT, Finalización); e.target.addEventListener(Scene3D.UPDATE_EVENT, bt1) e.target.addEventListener(Scene3D.UPDATE_EVENT, bt2) scene.addEventListener(Scene3D.UPDATE_EVENT, update) scene.camera.setPosition(40,50,400); scene.camera.lookAt(obj.x, obj.y, obj.z); seguir = false; segui = false; scene.rotateZ(0.50); scene.rotateX(0.50); function update(Event){ //scene.addEventListener(Scene3D.UPDATE_EVENT, update) scene.rotateZ(0.50); scene.rotateX(0.50); } var mc1:Mesh3D = obj.getChildByName("Cylinder01") as Mesh3D; mc1.addEventListener(MouseEvent.CLICK, bt1); var mc2:Mesh3D = obj.getChildByName("Box01") as Mesh3D; mc2.addEventListener(MouseEvent.CLICK, bt2); Cylinder01 = scene.getChildByName("Cylinder01") as Mesh3D; Box01 = scene.getChildByName("Box01") as Mesh3D; } function bt1(e:Event):void{ if(e.target.name == "Cylinder01") seguir = !seguir; if(seguir){ scene.resetTransforms(); Pivot3DUtils.setPositionWithReference(scene.camera,400,500,100,Cylinder01,0.1); Pivot3DUtils.lookAtWithReference( scene.camera,0,0,0,Cylinder01); }else{ //scene.resetTransforms(); Pivot3DUtils.setPositionWithReference(scene.camera,40,50,400,Cylinder01,0.1); Pivot3DUtils.lookAtWithReference( scene.camera,0,0,0,Cylinder01); } } function bt2(e:Event):void{ if(e.target.name == "Box01") segui = !segui; if(segui){ scene.resetTransforms(); Pivot3DUtils.setPositionWithReference(scene.camera,-900,50,10,Box01,0.1); Pivot3DUtils.lookAtWithReference( scene.camera,0,0,0,Box01); }else{ //scene.resetTransforms(); Pivot3DUtils.setPositionWithReference(scene.camera,40,50,400,Box01,0.1); Pivot3DUtils.lookAtWithReference( scene.camera,0,0,0,Box01); } }