5 Replies Latest reply on Oct 2, 2006 9:44 PM by kglad

    OOP Problem

    pong_gr Level 1
      Hi

      I have started digging in the classes thing and I am having a slight problem.

      I am making a menu class and each instance of the class will be an option of the menu.

      So I make my M1 class to extend MovieClip

      My thinking is to create some empty movie clips and put into them some text fields and then put some text in the empty fields. I use the class M1 to be able to keep some extra variables that I want and extend MC to keep all its properties.

      My constructor is:

      function M1 {
      _x = baseX;
      _y = baseY;
      element = numElements++;
      _alpha = 30;
      this.createTextField("txt", 1, 4, 4, 10, 10);
      txt.text = "Hello";
      }

      The problem is that the createTextField won't work... When an instance of my M1 class that extends MovieClip is created, isn't it a MovieClip? Why can't I create a text field in it? What am I not doing?

      Thanks for your time.

      Vasilis