2 Replies Latest reply on May 17, 2013 11:44 AM by Charine -FB buggoop

    AS3 Basic How to pass a method correctly?

    Charine -FB buggoop Level 1

      Hi.

      I'm building a word game. I made an array class that has to hold all the functions for the letters that will appear in the word game. (This class is linked to my main .as class file.)

       

      I made a constructor function with a list of all the things I want to do (to be defined in their own sub functions). For now I just placed trace ("this function") in the method until I write the real method next. The first statement works and I get the trace in the output box. But for the rest I get this error message:

       

                     1180: Call to a possibly undefined method initCheckIfLetterIsCorrect.//or init whatever the statement is for all 5 of them.

       

      What am I doing wrong?

      Thanks

      Charine

       

      Here is my code so far:

       

      package

      {

          import //all

        

          public class LetterArray extends MovieClip

          {

              private var _stage:Stage;

             

              public function LetterArray(s:Stage)

              {

                  _stage = stage;

                  initLetters();

                  initLetterWasClickedOn();

                  initCheckIfLetterIsCorrect();

                  initInGameAnimation();

                  initRemoveLetterChilren();

                  initPointsGiven();

              }

       

              public function initLetters():void

              {

                  trace("Initiation started");

                  //This one works. The rest do not

               }

       

              public function LetterWasClickedOn():void

                      {

                          trace("Letter was clicked on");

                       }

                     

              public function CheckIfLetterIsCorrect():void

                      {

                          trace("Check if letter is correct");

                       }

                     

              public function InGameAnimation():void

                      {

                          trace("InGameAnimation");

                       }

                     

              public function RemoveLetterChildren():void

                      {

                          trace("RemoveLetterChildren");

                        }

                     

              public function PointsGiven():void

                      {

                          trace("PointsGiven");

                       }