A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Dial Button and Gauge

  1. #1
    Junior Member
    Join Date
    Jan 2001
    Posts
    8
    I want to make a dial button and a gauge, when I rotate the button I want the arrow inside the gauge to falow the rotation. I like to know the code that makes the dial button comunicate and rotate the arrow inside the gauge.
    Anyone? I would much appreciate the help.

  2. #2
    Senior Member
    Join Date
    Jul 2000
    Posts
    128
    This may be an obvious question, but why not just put the arrow as part of the button graphic, so it rotates along by default?

    If that's not doable for some reason, make the arrow a movie clip, give it an instance name, then code it like so:

    arrow_name._rotation = dial_name._rotation;

    You'll need to have this code check itself continuously; the easiest way to do this for your purposes is probably to make it loop whenever the dial is being pressed.

    Even simpler (but slightly less processor-effecient) is to make the code on the arrow like this:

    onClipEvent (enterFrame) {
    _rotation = _root.dial_name._rotation;
    }

    assuming your dial is on the main timeline. The arrow only needs one frame; it will cycle continuously.

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