7 Replies Latest reply on Jan 19, 2009 10:15 AM by kglad

    Applying to all instances of a Class

    IaguCool
      Hi all. My question is a simple one.
      I have a class:
      quote:

      class Test extends MovieClip
      {
      static var hexColor:Number = 0x000000;

      var box:MovieClip;

      function Test()
      {
      this.init();
      }

      function init():Void
      {
      var colorObj:Object = new Color(this.box);
      colorObj.setRGB(Test.hexColor);
      }
      }


      And the library item is registered to this class and contains a MovieClip inside it with the instance name "box". The default color of the box is green, and is being changed to black as seen in the static variable.

      Now I have 3 instances of Test class's symbol: test1, test2 and test3.
      I would like to set (for example):
      Test.hexColor = 0xFFFFFF

      I would like to apply this new color tho all instances of the Test class.
      Going through the whole _root MovieClip is not an option since "Test" class symbols will be placed inside other MovieClips.

      Can anyone offer a solution?
      Thank you in advance!

      IaguCool.