A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Button actions

  1. #1
    Senior Member Black_phoenix's Avatar
    Join Date
    Oct 2000
    Location
    Leeds, UK
    Posts
    2,194

    Button actions

    Hi, just bought F8 and having massive problems adding a simple action to a button, much easier in Flash 5

    attatched a screenshot of what appears, all I want to do is attatch the action

    when clicked move to the next frame and stop

    any help appreciated, i'll also need to go back one frame on another button, mb I'm just missing something here

    thanks in advance

    bp
    Attached Images Attached Images

  2. #2
    Senior Member
    Join Date
    Oct 2001
    Posts
    219
    When doing a button you have to have what the person is going to do with the button before you can tell the button the task assigned...If you are going to attach the actionscript directly to the button..use this:

    on(release){
    gotoAndStop(frame number or frame label);
    }

    The recommended method is to put your script in the first frame of your timeline in a layer you label "action". Give your button an instance name, for example, myButton_btn. Use a script something like this:

    myButton_btn.onRelease = function(){
    gotoAndStop(frame number or frame label);
    };

  3. #3
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Or you could use script assist (known as normal mode before), then find commands from left panel and fill in the blanks.

  4. #4
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    hey black phoenix.

    Click the script assist button in the top right hand corner of the actions panel.

    Open the actions panel by selecting the button and pressing F9.

  5. #5
    Senior Member Black_phoenix's Avatar
    Join Date
    Oct 2000
    Location
    Leeds, UK
    Posts
    2,194
    Hi thanks for the reply, I have got the button working just copied and pasted the text from Flash 5 to flash 8, what does concern me is that in flash 5 you have 'basic actions' and from there you just click what you want and it generates the code, cant seem to find the same type of thing in flash 8 i'm looking in Global functions > Timeline control, I guessed it would be in there.

    thanks again

    bp

  6. #6
    Senior Member
    Join Date
    Oct 2001
    Posts
    219
    I haven't found the new system in Flash 8 to be very useful because it's about as hard to find where the proper code is as it is to just write the stuff in the first place. Of course, I'm not being very fair since I haven't used the script assist much and I've become accustomed to "rolling my own" since MX2004.

  7. #7
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Yes, I agree, I liked the basic actions selection in Flash5 too. In Flash8 you need to know where the functions would be before you can use it and I guess most people needing script assist have no idea where to start looking for it.

  8. #8
    Senior Member Black_phoenix's Avatar
    Join Date
    Oct 2000
    Location
    Leeds, UK
    Posts
    2,194
    I have always been a fan of Macromedia, but this new version will hamper people who are just starting out using Flash 8, adding a button action should be so straight forward. The script assist is ok if you have the correct script in there, but its no use if you get it wrong as it wont help you until you get it right.

    bp

    thanks again for the replies

  9. #9
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    I'm not sure I understand. If I have a button on the stage, bring up the Actions Panel with Script Assist on, I can double-click "goto" under Timeline Control and it automatically enters for me:

    on (release) {
    gotoAndPlay(1);
    }

    With fields above to customize the action. What's different about this then Basic Mode in Flash 5?

  10. #10
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Quote Originally Posted by rdoyle720
    With fields above to customize the action. What's different about this then Basic Mode in Flash 5?
    You need to know goto action is under Timeline Control. In Flash5 most of the simple and common commands were all nicely under basic actions.

  11. #11
    Senior Member Black_phoenix's Avatar
    Join Date
    Oct 2000
    Location
    Leeds, UK
    Posts
    2,194
    i'm still wanting to know what you do with the little pop up panel when you select an action (see screenshot)

    what are you supposed to put in there?

    bp

  12. #12
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Ignore it for the most part, just type in your frame number.

    Don't you have a small panel to the left of the actions panel with all the folders in it? And below the folders, a yellow folder named Index? Open Index, then all the actions in all the folders above that are there, laid out in alpabetical order. That's all I use, I never used the folders, cause I never learned where they all were.

  13. #13
    Member
    Join Date
    Mar 2003
    Posts
    50
    FINALLY someone else has the same problem that I am having. Scripting in 8 is so much more difficult for someone like me who only uses the 'basic functions' on Flash 5. I just don't understand scripting very well otherwise.

    Anyway, the answer to black_phoenix's question, albeit 3 years later, is that the mouse events function is now under Global Functions > Movie Clip Control > On

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