A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Need help with buttons

  1. #1
    Junior Member
    Join Date
    May 2003
    Posts
    2

    Need help with buttons

    I've got two buttons that rotate a movie clip clockwise and anti-clockwise. At the moment, they only rotate a step at a time while the mouse button is held down but I want them to continuously rotate while the mouse button is held down.

    I'm using Flash MX and the current code is as follows:

    Code:
    on(press) {
     // rotate the protractor anti-clockwise.
     protractor._rotation += -1;
    }
    (obviously, the value is '1' for clockwise)

    Can anyone help with this? It's quite urgent to get this done so the timer's ticking...

    Cheers very much!

  2. #2
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    on(press) {
    protractor.onEnterFrame = function(){
    protractor._rotation -= 1;
    }
    }
    on(release){
    delete protractor.onEnterFrame;
    }

  3. #3
    Junior Member
    Join Date
    May 2003
    Posts
    2
    Cheers for that mate - works like a charm!

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