2 Replies Latest reply on Jan 11, 2010 8:53 AM by MATTANDIE

    Buttons don't recognize frame script

    Limon26 Level 1

      I have frame scripts on the first frame of my root timeline, and extend that frame through the whole flash file

      The buttons that use it don't show up until later, say the 5th or 6th frame.

       

      They don't seem to recognize the 1st frame script even though I have extended the frame to where the button shows up.

       

      It seems if I make a keyframe with that script above each frame where the button starts, it will work, but is there

      any easier way to do this.  Because if I have to make a change to the code, I have to copy it to each frame?

        • 1. Re: Buttons don't recognize frame script
          kglad Adobe Community Professional & MVP

          if you try and reference objects (like your buttons) before they exist, flash will not be able to use your coding.

           

          to remedy, create your buttons in frame 1.  you can always use their _visible property to make them appear and not appear when it suits your needs.

          1 person found this helpful
          • 2. Re: Buttons don't recognize frame script
            MATTANDIE Level 1

            What Kglad suggests is probably the simplest solution if you are using frame scripts.

             

             

            Other than that, you could:

             

            Code directly on the MC or Button (simple, but not recommended)

             

            or

             

            You could set up an interval or enterframe function that could call your desired functionality for the button. ( more complex, and probably overkill for 1 or two buttons.)

             

            M.