I always have problems with classes :(, Attaching a Class? HElP!


i have main.as asigned documnetclass

 

this class creates movieclip called childlike this

 

var c:child = new child  ;

addchild(c);

 

i have class called child.as

 

package  {

          import flash.display.movieclip;

 

          public class child extends movieclip

          {

       

                    //this number match index of details in arrays belong child

                    var childnumber:number;

                    public function child() {

                              declarechildstats();

                    }

        private function declarechildstats()

                    {

                    }

          }

 

}

 

 

this class set stats each indvidual child, can working when run swf

 

typeerror: error #1009: cannot access property or method of null object reference.

 

capture.jpg

 

bacicly adding child scene.

i want child use class child.as.

 

but wont , errors. why cant things simple

that should be

 

var c:child=new child();

 

and, line of code triggering error (file>publish settings>swf>tick "permit debugging")?



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account