Still can't get classes perfectly... HELP!
I'm a decent as 3 programmer but I still cannot figu
re out how to use classes 100%. I've always programmed with everything on the main timeline in frame
1 with a ton of functions. I'm working on a big project and I'd like to clean this up a little and it makes sense to build classes for t
hings. However I cannot figure out the communication between classes.
I have a DocClass. That DocClass import Class_A and Class_B:
public class DocClass extends MovieClip {
public var _instance:DocClass;
public var class_a:Class_A;
public var class_b:Class_B;
public function DocClass() {
// constructor code
trace("main constructor");
class_a = new Class_A();
//class_b = new Class_B();
}
public static function myFunction():void{
trace("here at my function");
}
}
From the main timeline I can call the method myFunction just fine. However, I cannot call any function in Class_A or Class_B from the main timeline, why?
Class_A
public class Class_A {
public function Class_A() {
// constructor code
trace("class a constructor") }
public static function myAFunction():void{
trace("here at a my function");
}
}
Doc Class loads Class_A but Class_A isn't available to call from the main timeline....