I always have problems with classes :(, Attaching a Class? HElP!
I have a Main.as which is asigned as my DocumnetClass
This Class Creates a MovieClip Called Childlike this
var c:Child = new Child ;
addChild(c);
I have a class also called Child.as
package {
import flash.display.MovieClip;
public class Child extends MovieClip
{
//This number will match the index of the details in the arrays which belong to that Child
var ChildNumber:Number;
public function Child() {
DeclareChildStats();
}
private function DeclareChildStats()
{
}
}
}
This class will set the stats for each indvidual child, But I can get it working when I run the swf I just get
TypeError: Error #1009: Cannot access a property or method of a null object reference.
Bacicly I am adding the child to the scene.
I want the child to use its class Child.as.
But It wont and I get errors. Why cant things be simple ![]()
