dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Buttons...and...AS3

  1. #1
    Junior Member
    Join Date
    Dec 2007
    Posts
    18

    Exclamation Buttons...and...AS3

    OK, I have searched high and low on the internet on how to make a button in AS3 but I can't find ANYTHING. Everything is AS2. I created my document in AS3, so I dont think I can change it back to AS2.

    I heard something about the button using "listeners" or something now. However, I just started using flash and I really have no idea what that means.

    Any help would be great.

    Thanks
    D

    (My project is due in like an hour and the machines at school cant open CS3 files....heh...crappy POSes....)

  2. #2
    Member
    Join Date
    Jun 2007
    Posts
    41
    If you are using a symbol for your button, add this to the actions of your first frame, or where ever you need it.

    Code:
    myBtn.addEventListener(MouseEvent.CLICK, clickedButton);
    
    function clickedButton (event:MouseEvent)
    {
            //Do something here
    }
    Here is a link for Flex AS3 Language Reference, http://livedocs.adobe.com/labs/flex/3/langref/
    and for SimpleButton
    http://livedocs.adobe.com/labs/flex/...pleButton.html

    Im pretty sure Flash CS3 doesnt use SimpleButton if you create a button symbol, but if you scroll down to the "Events" of SimpleButton in the link above, you should be able to use them just the same.

    The language reference above does cover the Button Class used by CS3, but Im not sure what package its in, or what its called.

  3. #3
    Member
    Join Date
    Jun 2007
    Posts
    41
    I found this ...

    It seems that when you create a Symbol of type Button in your library and that you don't assign any class to it, Flash CS3 will compile this symbol as extending the SimpleButton class.
    So, the link for SimpleButton above will tell you everything you need.

  4. #4
    Junior Member
    Join Date
    Dec 2007
    Posts
    18
    crap, AS3 sucks. Way more simple in AS2....T.T My brain is fried now.

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