3 Replies Latest reply on Oct 11, 2006 5:39 PM by LSNsaltlamp

    creating dynamic buttons

    xaosai
      I am attempting to create a dynamic mailto button and have run into some problems.

      First, I realized that a dynamic text field inside of a button renders a "hole" in the button where ever there is dynamic text.

      I then found a method by reading forums that supposedly should work. I have taken the following steps:

      setup:
      1 - Created a button symbol in the library that defines the clickable space
      2 - Created a movie symbol in the library that will house the dynamic content
      3 - Created a dynamic text field inside the movie symbol
      4 - Created 3 frames inside the movie for each state of the button and labeled accordingly (out, over, click)
      5 - Modified the dynamic text box color for each frame accordingly

      event handling:
      6 - named the instance of the movie "email" in order to reference through action script
      7 - Added the following AS to an instance of the clickable button area:

      on (rollOut) {
      email.gotoAndStop("out");
      }
      on (rollOver) {
      email.gotoAndStop("over");
      }
      on (press) {
      email.gotoAndStop("click");
      }
      on (releaseOutside) {
      email.gotoAndStop("out");
      }
      on (release) {
      email.gotoAndStop("over");
      //place mailto here
      }

      I get the following error from the output:

      **Error** Scene=treatment, layer=hit, frame=1:Line 1: Mouse events are permitted only for button instances
      on (rollOut) {

      **Error** Scene=treatment, layer=hit, frame=1:Line 5: Mouse events are permitted only for button instances
      on (rollOver) {

      **Error** Scene=treatment, layer=hit, frame=1:Line 10: Mouse events are permitted only for button instances
      on (press) {

      **Error** Scene=treatment, layer=hit, frame=1:Line 13: Mouse events are permitted only for button instances
      on (releaseOutside) {

      **Error** Scene=treatment, layer=hit, frame=1:Line 16: Mouse events are permitted only for button instances
      on (release) {

      Why would this be the case?? I created the instance by dragging the button from the library onto the stage. Is that not the proper way to create an instance?