Hi once again I thought I understood Getter and Setter but it seems not well enough.
I need a class from where I can access a variable to any other class.
The code bits show 3 classes Xfer,Kraft and Menu.
Kraft sends the Variable but I cannot receive it through Menu.
Can anyone put me right please, hopefully for the last time:-)
Best regards. FJW
<code>
package
{
import flash.geom.Vector3D;
import away3d.primitives.Plane;
public class Xfer
{
private var _thePoints:Plane;
public function Xfer(){}
public function set thePoints(value:Plane)
{
_thePoints = value;
//trace("Xfer SET",_thePoints);
}
public function get thePoints():Plane
{
// trace("Xfer GET",_thePoints);
return _thePoints;
}
}//End Class
}//End package Xfer
package
{
public class Kraft extends AwayTemplate
{
private var fpsWalker:FPSController;
private var _sentPlane:Plane;
private var _sendVector:Xfer;
}
public function Kraft()
{
super();
}
private function setupView():void
{
///////////init FPS/////////////////
fpsWalker=new FPSController();
}
override protected function onEnterFrame(e:Event) : void
{
super.onEnterFrame(e);
fpsWalker.walk();
_sentPlane=fpsWalker.walk(); //returns plane Vector OK
//Need to be able to reference this Vector in other classes
_sendVector = new Xfer();
//trace(“Before”,_sendVector.thePoints); //Null
_sendVector.thePoints =_sentPlane;
//trace(“After”,_sendVector.thePoints); //Valid
}
}//End Class
}//End Package Kraft
package {
public class Menu
{
public function Menu()
{
}
private function buildWall():void
{
//vector required from Xfer.
var getVector:Xfer = new Xfer(); //Valid
trace("Menu",getVector.thePoints); //Null
}
}//End Class
}//End Package Menu
</code>