9 Replies Latest reply on Oct 21, 2008 1:08 PM by kglad

    on (release) not firing

    sm5574
      I know someone recently asked a similar question, but I do not believe my problem is an issue of scope.

      I have a button symbol. I have place the following code in the ActionScript of the button:

      on (release) {
      trace("Hit me, baby, one more time! ");
      }

      This never fires. The button exists for the duration of the program, but this never fires, no matter when or how many times I click on the button.

      I am using CS3, recently installed and updated.

      Thanks in advance for any insights you may have.
        • 1. Re: on (release) not firing
          Level 7
          sm5574,

          > I have a button symbol. I have place the following code in the
          > ActionScript of the button:
          >
          > on (release) {
          > trace("Hit me, baby, one more time! ");
          > }

          That sounds about as basic as it gets. In order for this to work, your
          FLA would have to be configured for ActionScript 1.0 or 2.0.

          > This never fires. The button exists for the duration of the program,
          > but this never fires, no matter when or how many times I click on
          > the button.

          Do you have trace() statements turned on? Check your Publish Settings
          (Edit > Publish Settings > Flash) and make sure the "Omit trace statements"
          checkbox does *not* have a checkmark. Also, open your Output panel (Window
          > Output) and click the upper right context meny (below the "X" that closes
          the panel) to make sure the choice under Filter Level is set to Verbose, as
          opposed to None. Either of those would keep any trace statements from
          showing.

          > I am using CS3, recently installed and updated.
          >
          > Thanks in advance for any insights you may have.

          Let's start with those, and see what happens.


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. on (release) not firing
            sm5574 Level 1
            quote:

            your FLA would have to be configured for ActionScript 1.0 or 2.0
            It's set for 2.0.

            quote:

            Do you have trace() statements turned on?
            Trace statements are on. In fact, I have a trace statement in the first frame of another layer that works perfectly.

            This is a more sophisticated movie than just the one button. However, everything was working fine when I was using a listener. But I need this to be compatible with a web ad host, and that means using the on (release) code as they have prescribed. And as I have said, I have not been able to get that to work in even the most rudimentary way.

            There's really nothing else going on in the movie, though. It's all animation. I put a trace command in the first frame, as I said above, and I put a stop command in the last frame. That's it, other than the on (release) thing that doesn't work.
            • 3. Re: on (release) not firing
              kglad Adobe Community Professional & MVP
              you probably have a mouse handler defined for a parent of your button and it's intercepting mouse events.
              • 4. Re: on (release) not firing
                sm5574 Level 1
                In the Actions frame, I only have the button listed, along with the other two frames I mentioned (the trace and the stop). It doesn't show anything else having script associated with it. I did not intentionally add another mouse handler, and I deleted the listener script I wrote. Could such a handler exist somewhere else?
                • 5. Re: on (release) not firing
                  kglad Adobe Community Professional & MVP
                  yes. is you button on any movieclip timeline OTHER than the main timeline?
                  • 6. Re: on (release) not firing
                    sm5574 Level 1
                    I don't have any other timelines.
                    • 7. Re: on (release) not firing
                      kglad Adobe Community Professional & MVP
                      click on frame 1 of the main timeline and then click on your button that's on-stage in frame1. do you see your code in the actions panel?

                      if not, that's the problem. if yes, post a link to your fla.
                      • 8. Re: on (release) not firing
                        sm5574 Level 1
                        The code is in the button.

                        I have found a workaround, though. I converted an existing shape into a button, and it works fine with exactly the same code. So I have no idea what the problem was, but the movie works now, so all is good.

                        Thank you for your help, though.
                        • 9. Re: on (release) not firing
                          kglad Adobe Community Professional & MVP
                          you're welcome.