A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: as3 and buttons

  1. #1
    Member
    Join Date
    Aug 2008
    Posts
    78

    as3 and buttons

    Hi again. Sorry to bombard you with questions but when I used as1 and imported a KM button there was an option to add AS to the button. That's not the case with as3 (or have I missed it?) - is the only way to add it via the frame or within the button frame?

    If I could add this to a button maybe I can finally have my new_clock arms go backwards??

    var direction:int = 1; //change to -1 to reverse rotation.

    function onClick(event:MouseEvent):void{
    var increment:int = 30 * direction;
    DisplayObject(event.currentTarget).rotation += increment;
    }

    thanks,
    ja
    Last edited by jarnold; 01-06-2010 at 06:32 AM.

  2. #2
    Super Moderator
    Join Date
    Jun 2000
    Posts
    3,512
    With AS3, you add the action to a main movie frame.

  3. #3
    Member
    Join Date
    Aug 2008
    Posts
    78
    Thanks for the reply, Bob.

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