1 Reply Latest reply on Aug 15, 2009 9:26 PM by kglad

    How to pull button code, and use it in main timeline?

    JustIncredible76

      I have a Flash project which has about 90% of its code in the first frame, on a layer called 'actions'. the remeainder of the code is attached to several buttons throughout the project. I want to take the code attached to the buttons, and paste it into the first frame, 'actions' layer. what I want to know is how to do it, and still have the buttons function properly. This is in AS2, and will eventually be converted to AS3, when I get all the working code on the first frame.

       

      I don't know how to reference it, from the first frame of 'actions' layer.

       

      For example, on one button, the code is one line:   gotoAndStop(this._parent._name);

       

      On another button, the code is:

       

      function aa(bb)
      {
          first = true;
          bb[subActive].gotoAndPlay(2);
          clearInterval(id);
      }
      if (this._name == active)
      {
          id = setInterval(aa, 10, this);
      }

       

      I assume I reference it through its instance name, but not sure what follows.

       

      (Or, would someone be kind enough to convert it from AS2 to AS3?)

       

      thanks.