I have a scene (“mother”) with several buttons. Every button load an external swf (“son01,son02…”).
The scene “son…” has buttons that control a collada object(papervision3d) with a function(ERonEnter).
I have a problem: When I press a second button to unload the scene son… there is an error
Could you help me?, thanks and sorry for my english.
TypeError: Error #1009: No se puede acceder a una propiedad o a un método de una referencia a un objeto nulo.
at LC15_TEST_fla::MainTimeline/EROnEnter()
and the code:
stop();
import flash.display.Loader
import flash.events.*
import flash.net.URLRequest
var urlRequestLC15:URLRequest=new URLRequest("LC15_TEST.swf")
var loaderLC15:Loader=new Loader()
loaderLC15.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete)
loaderLC15.x=-5
function onComplete (e:Event):void
{
addChild(loaderLC15)
}
LC15_mc.buttonMode=true
LC42S_mc.buttonMode=true
LC7_mc.buttonMode=true
LC15_mc.addEventListener(MouseEvent.CLICK,LC15)
function LC15(e:MouseEvent):void
{
loaderLC15.load(urlRequestLC15)
}
close_btn.addEventListener(MouseEvent.CLICK,onClosed)
function onClosed (e:MouseEvent):void{
loaderLC15.unload()
removeChild(loaderLC15)
}
and the code function for the scene son
function EROnEnter(e:Event):void {
this.mScene.renderCamera( mCamera )
this.stage.quality = "HIGH";
this.stage.scaleMode = "noScale";
this.stage.addEventListener(MouseEvent.MOUSE_DOWN, ERMouseDownHandler);
this.stage.addEventListener(MouseEvent.MOUSE_UP, ERMouseUpHandler);
this.stage.addEventListener(MouseEvent.MOUSE_WHEEL, ERMouseWheelHandler);
//mRotationAnchor = new Number3D;
// Perform the 3D initialization.
}