How to Do onClick Changes for Images in Flash

The ActionScript language works with Flash to help webmasters create dynamic buttons and images. Button rollover effects let you change an image when the user hovers the mouse over it, and you can also change an image when the user clicks the button. You use the "onPress" event to trigger changes after the "onClick" event in Flash.

Instructions

    • 1

      Open your ActionScript editor and open the Web Flash project in the editor. Double-click the file you want to use to create the onClick effects.

    • 2

      Create the ActionScript function to handle the image changes. For instance, if you want to change the image to "pop out" at the user when the user clicks the button, the following function makes the image larger when the button is clicked:

      function increaseSize() {
      this._yscale = 120;
      this._xscale = 120;
      }

    • 3

      Add the function to the "onPress" event for the button. The following code assigns the "increaseSize" function to the "onPress" event, which means the function runs when the user clicks the button:

      this.onPress = increase();

Related Searches:

References

Comments

Related Ads

Featured