我在使用庫中的MovieClip創建交互式動畫飛機時遇到了一些麻煩,以顯示任何類型的動畫或接收任何鼠標事件。交互式飛機遇到問題
具體來說,我遇到了MovieClip中Button實例的不同狀態問題。
下面是我與測試的基本代碼:
private function init3D():void
{
viewport = new Viewport3D(1024, 768, false, true);
addChild(viewport);
camera = new Camera3D();
camera.z = -500;
camera.zoom = 1;
camera.focus = 500;
camera.target = DisplayObject3D.ZERO;
scene = new Scene3D();
renderer = new BasicRenderEngine();
stage.addEventListener(Event.ENTER_FRAME, loop);
}
public function addChild3D(link:String):Plane
{
//var demoPlane:DemoPlane = new DemoPlane(link);
//return scene.addChild(demoPlane.getPlane());
var material:MovieAssetMaterial = new MovieAssetMaterial(link, false, true, false, false);
material.interactive = true;
//material.smooth = true;
material.animated = true;
var plane_mc:Plane = new Plane(material, 0, 0, 10, 10);
scene.addChild(plane_mc);
}
private function loop(evt:Event):void
{
renderer.renderScene(scene, camera, viewport);
}
糾正我,如果我錯了,但我看不出有什麼處理程序代碼中的任何按鈕。 – 2009-08-25 18:28:17
處理程序位於我使用addChild3D添加的MovieClip中: start_btn.addEventListener(MouseEvent.CLICK,startDemo); – 2009-08-25 18:34:19