A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Adding actions to buttons?

  1. #1
    Junior Member
    Join Date
    Jul 2002
    Posts
    9
    Hi again

    Ok I got the buttons working all fine.
    But now I want to add AS to them. Im using Flash Mx, and I blame the new interface for most of my problems LOL!

    Ok heres the script im using.

    ------------------------------------------
    on (rollOver) {
    gotoAndStop(85);
    }
    on (rollOut) {
    gotoAndStop(65);
    }
    -----------------------------------------------

    Now that works all fine and what not. Problem Starts when I goto the next button add the same AS but i change the
    85 to 86.
    for some reason I am unaware of it changes the first buttons AS to that of the second buttons AS.

    I hope that is easy enough to understand.
    I need each button to gotoand stop at a different frame and its not working right

    Thanks in advance

  2. #2
    Moderator enpstudios's Avatar
    Join Date
    Jun 2001
    Location
    Tampa, Fl.
    Posts
    11,282
    Sounds like your using the same instance of the button.
    In the library right click the button > Select Duplicate > Give your new button a unique name.

    Also give each button an instance name, then use the new Flash MX way of scripting: Example:

    In frame 1 of your movie use this AS:

    Code:
    myButton.onRollover = function() {
      gotoAndStop(85);
    myButton.onRollout = function() {
      gotoAndStop(65);
    myButton1.onRollover = function() {
      gotoAndStop(86);
    myButton1.onRollout = function() {
      gotoAndStop(66);

  3. #3
    Junior Member
    Join Date
    Jul 2002
    Posts
    9

    Thank You

    Yeah,
    I Frickin used the same instance, how i managed to do that i dont know.

    Playing with the new AS method decided I like it more than the old way just needed to understand it first
    Thanks for the help though.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center