# Unload Error

**URL:** <https://forum.kirupa.com/t/unload-error/269155>\
**Category:** Uncategorized\
**Created:** [August 23, 2008, 1:12pm UTC](https://forum.kirupa.com/t/unload-error/269155 "2008-08-23T13:12:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rhx2060](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@rhx2060](https://forum.kirupa.com/u/rhx2060)\
**Post date:** [August 23, 2008, 1:12pm UTC](https://forum.kirupa.com/t/unload-error/269155/1 "2008-08-23T13:12:30Z")

</div>

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.

```auto

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:

```auto
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

```auto
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.
}

```
