Hi
I got several classes, each in it’s own .as file, for better code organization.
I want one of the class to be able to access properties and methods of another class’ instance.
So here’s my document class (ob.as)
package
{
import flash.display.MovieClip;
public class ob extends MovieClip
{
public static var ad:SYSTEM;
public static var da:PhysicsRenderer;
public function ob():void
{
ad = new SYSTEM();
da = new PhysicsRenderer();
}
}
}
SYSTEM.as:
package
{
public class SYSTEM
{
public function SYSTEM():void
{
trace("SYSTEM constructor");
}
public static function lol():void
{
trace("lol()");
}
}
}
PhysicsRenderer.as:
package
{
public class PhysicsRenderer
{
public function PhysicsRenderer():void
{
ob.ad.lol();
}
}
}
On the PhysicsRenderer class, it seems I can actually access the instance (i.e. tracing ob.ad actually outputs something), but the lol() method doesn’t work. Neither does any properties, if I add them.
Has anyone else encountered this problem, or perhaps know a solution to this?
Thanks in Advance, Max