User Tag List

Results 1 to 4 of 4

Thread: Dragging a clock's hand... Math question

  1. #1
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleInstall Creator Pro
    Christian_Wheel's Avatar
    Join Date
    Mar 2010
    Location
    Los Angeles
    Posts
    371
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Dragging a clock's hand... Math question

    Here's the project...

    I have a sound file that's exactly 60 minutes long. I need to create a clock, with a minute hand, that moves in accordance with the sound's playback. That part's easy.

    If the user clicks-and-drags the minute hand, it should seek to the appropriate time in the sound file.

    I'm having a heck of a time with the math calculations. My minute hand is an Active Object that has its Action Point on one end, and I can set the Angle of the object as necessary.

    However, when the user clicks on it, I need to calculate the relative angle from the Action Point of the minute hand to the mouse pointer.

    I have tried the Advanced Direction Object, but I can't see any of the options I'd need. Unless I'm missing it....

    The other catch is it has to work in Flash. So I'm limited to the objects that are built into the flash runtime.

    Any suggestions? Thanks in advance!

  2. #2
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Dragging a clock's hand... Math question

    atan2(y2-y1,x1-x2)will give you the angle between two points. This assumes that by default the object faces right.

    atan2(Y("Hand"),ymouse,xmouse-X("Hand"))

  3. #3
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleInstall Creator Pro
    Christian_Wheel's Avatar
    Join Date
    Mar 2010
    Location
    Los Angeles
    Posts
    371
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Dragging a clock's hand... Math question

    Thanks! It works... Kinda. It seems to be moving in the inverse direction when I click and drag, but on the bottom half of the clock things get all weird. Will keep experimenting.

    Edit: Had the formula in incorrectly. Now that it's as listed above, here are my results. What's wrong?

    http://bit.ly/9F621l

  4. #4
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleInstall Creator Pro
    Christian_Wheel's Avatar
    Join Date
    Mar 2010
    Location
    Los Angeles
    Posts
    371
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Dragging a clock's hand... Math question

    Got it. Had to multiply the result by -1.

Similar Threads

  1. Math question
    By FlinkGigitty in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 15th September 2010, 01:21 PM
  2. Clock zero question?
    By twister in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 8th June 2010, 01:13 AM
  3. how to make hand (on a clock)?
    By piki in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 17th March 2008, 07:47 AM
  4. Very easy hand for a clock
    By Ravenius in forum File Archive
    Replies: 0
    Last Post: 16th March 2008, 05:03 PM
  5. hand of clock "thing" for piki
    By SEELE in forum File Archive
    Replies: 1
    Last Post: 16th March 2008, 04:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •