• home
  • forum
  • my
  • kt
  • download
  • Buttons

    Author: 2008-09-28 10:08:05 From:

    Buttons simple to use, create and one of the most useful things in Flash. Let�s start by creating a button.

    Right click inside the library tab and select "New Symbol..."
    Free Flash Tutorials, Basic Flash, Buttons
    Don�t forget to check "Button" and to give it a name.

    I may have noticed that the timeline is different from the usual. This one only has four frames: "Up", "Over", "Down" and "Hit". They represent the states of the button.
    Free Flash Tutorials, Basic Flash, Buttons

    On the "Up" frame you draw how you want your button to look like when it�s not being clicked and doesn�t have the mouse over it.
    If you want to make more complex buttons you can add more layer to the timeline just line for a Movie Clip. In fact, you can also add a Movie Clip inside your Button! Try later to animate a Movie Clip and drag it to one of your button�s frame. Free Flash Tutorials, Basic Flash, Buttons

    The "Over" frame is how you button looks when the mouse is over it, but not clicking.
    Free Flash Tutorials, Basic Flash, Buttons

    "Down" frame is your button when the mouse is being pressed over it.
    Free Flash Tutorials, Basic Flash, Buttons

    And "Hit" is the area where the mouse events occur.
    So if you draw a smaller button on this frame, the over and down event will only happen if the mouse is in that small area. For our tutorial leave this frame empty.

    Now let�s move to the actionscript part.
    The main events for buttons are:
    //When the mouse is pressed over the button. onPress = function() { } //Mouse was pressed in the button then released. onRelease = function() { } //Mouse pressed over the button then released outside the button. onReleaseOutside = function() { } //Mouse rolls over the button. onRollOver = function() { } //Mouse rolls out. onRollOut = function() { }
    Just add your code between the curly braces and test it.

    That�s all for this tutorial.

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      3D (20)
      Math Physics (14)
      3rd Party (5)
      Navigation (60)
      Actionscripting (26)
      Optimization (16)
      Animation (32)
      Projector (9)
      Audio (46)
      Special Effects (112)
      Backend (25)
      Text Effects (65)
      Drawing (18)
      Tips and Techniques (41)
      Dynamic Content (25)
      Tricks (6)
      Games (66)
      Utilities (19)
      Getting Started (80)
      Video (24)
      Interactivity (43)
      Web Design (29)

    New

    Hot