# Hype objecpool with external class "clip"

**URL:** <https://forum.kirupa.com/t/hype-objecpool-with-external-class-clip/316448>\
**Category:** Uncategorized\
**Created:** [November 22, 2010, 4:21am UTC](https://forum.kirupa.com/t/hype-objecpool-with-external-class-clip/316448 "2010-11-22T04:21:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ventoline](https://avatars.discourse-cdn.com/v4/letter/v/dec6dc/32.png) [@ventoline](https://forum.kirupa.com/u/ventoline)\
**Post date:** [November 22, 2010, 4:21am UTC](https://forum.kirupa.com/t/hype-objecpool-with-external-class-clip/316448/1 "2010-11-22T04:21:35Z")

</div>

I am trying to create a swarm behaviour with a papervision 3D cube, but to create an object pool i need to pass a Class, so i tried creating an external class “flyingCube”

```auto

		public function flyingCube() {
					 var cube = new Cube(null,240, 240, 240,1,1);
		}

```

and import it into my main

```auto

var pool:ObjectPool = new ObjectPool(flyingCube, 20);

```

i get this error

```auto

TypeError: Error #1009: Cannot access a property or method of a null object reference.
	at org.papervision3d.objects.primitives::Cube()
	at flyingCube()
	at hype.framework.core::ObjectPool/makeRandomObject()
	at hype.framework.core::ObjectPool/request()
	at Function/<anonymous>()
	..

```

what i am doing wrong (i am not an advanced coder so it could be obvious ^^)
