# OOP problem again passing an array

**URL:** <https://forum.kirupa.com/t/oop-problem-again-passing-an-array/330298>\
**Category:** flash\
**Created:** [December 27, 2012, 1:54pm UTC](https://forum.kirupa.com/t/oop-problem-again-passing-an-array/330298 "2012-12-27T13:54:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FJW](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@FJW](https://forum.kirupa.com/u/FJW)\
**Post date:** [December 27, 2012, 1:54pm UTC](https://forum.kirupa.com/t/oop-problem-again-passing-an-array/330298/1 "2012-12-27T13:54:03Z")

</div>

Hi Guys hope you all had a great Christmas. Perhaps you could find some time to help with this. have 2 classes as follows and wish to pass the pointsArray Array from Basic class to the tools class.  
\<CODE\>  
package  
{  
import away3d.materials.BitmapMaterial;  
import away3d.materials.BitmapFileMaterial;  
import away3d.core.utils.Cast;  
import away3d.sprites.Sprite3D;  
import away3d.core.base.Mesh;  
import away3d.containers.View3D;  
import away3d.core.base.Object3D;  
import away3d.primitives.Plane;

import flash.display.Sprite;  
import flash.display.Stage;

```
public class tools 
{
  private var _thestage:Stage;

```

private var \_thecamera:Object3D;  
private var \_theview:View3D;  
private var \_thePoints:Basic; //need pointsArray  
private var \_theplane:Plane;

private var \_theArray:Array;

```
    public function tools(view,camera,stage,plane)
    {
       _theview=view;
 _thecamera=camera;
 _thestage=stage;
 _theplane=plane;
    }

```

public function POINTS()  
{  
\_thePoints = new Basic( \_theview,\_thecamera,\_thestage);  
trace(“Tool”,\_thePoints.WallPoints); //NULL  
//\_theArray = pointsArray;  
}  
}//End Class  
}//End package

package {

import away3d.primitives.Cube;  
import away3d.materials.ColorMaterial;  
import away3d.core.utils.Init;  
import away3d.core.base.Object3D;  
import away3d.core.utils.Cast;  
import away3d.materials.BitmapMaterial;  
import away3d.containers.View3D;  
import away3d.events.\*;

import flash.display.Stage;

public class Basic  
{  
private var thestage:Stage;  
private var thecamera:Object3D;  
private var theview:View3D;

private var pointsArray:Array; //pass this to tools class

public function Basic(view,camera,stage)  
{  
thestage=stage;  
thecamera=camera;  
theview=view  
}  
private function onMouseDown(ev:MouseEvent3D) :void  
{  
Obj = ev.object;  
pointsArray = new Array();  
pointsArray.push(Obj);  
Obj=null;  
//trace(pointsArray);  
}

public function get WallPoints():Array  
{  
return pointsArray;  
}  
}//End Class  
}//End package

\</code\>
