User Tag List

Results 1 to 6 of 6

Thread: Distance between? <-- plz sum1 take a peek! :)

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleSWF Export Module

    Join Date
    Sep 2006
    Location
    UK
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Distance between? <-- plz sum1 take a peek! :)

    Hi, in mmf 1.5 i used to use the "movement" obj to get the distance between two points? is there an extension to do so in mmf2? I tried a search on here and found what looked like a way to do it without extension, something along the lines of :

    [color:#000099]Sqr(((X( "Object 1" ) - X( "Object 2" )) Pow 2 )+ ((Y( "Object 1" ) - Y( "Object 2" ) Pow 2)))[/color]

    But in there where it says object 1 and 2 ETC, i want the mouse X and Ys? well what would i put in? ive tried like Xmouse and Ymouse but just get syntax error.

    Thanks
    Gib

  2. #2
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Distance between?

    you need to replace X("Object 1") with either XMouse or X Mouse, and the same for Y. So something like:
    Sqr(((X( "Object 1" ) - XMouse) Pow 2) + ((Y( "Object 1" ) - YMouse) Pow 2))

    The formula basically means "the square root of (the difference in x position squared plus the difference in y position squared)". It's simple Pythagoras from school.

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleSWF Export Module

    Join Date
    Sep 2006
    Location
    UK
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Distance between?

    Ok, well thats not sort of but kind of working? maybe you could tell me where im going wrong, al im trying to do is make it so when you click on a say picture and move it with a mouse, if you just set it so the pics X & Y are at the Mouses X & Y then it jumps to the hotspot, well i want it so where ever you click on the picture it moves it from that point get me?

    So i have two globals now
    A=Sqr(((XMouse-Y( "Active" )) pow 2)+((XMouse-YMouse) pow 2))
    B=Sqr(((X( "Active" )-YMouse) pow 2)+((XMouse-YMouse) pow 2))

    Oh and the "Active" is set at 0,0 of the picture!

    And then i set the picture or what ever object
    "when mouse is clicked blah blah"
    X=XMouse-Global Value A
    Y=YMouse-Global Value B

    And at the moment, if you click on the picture it jumps up about about 200 pixels, but STILL moves with the mouse just offset by alot, but ive noticed the nearer the center of the picture you click, the LESS offset it is to the mouse?

    any help will be much appricieated.
    Cheers
    Andy

  4. #4
    No Products Registered

    Join Date
    Jun 2006
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Distance between?

    I'm not sure how you got them 2 expressions, what you want is this:

    A = X( "Active" ) - XMouse
    B = Y( "Active" ) - YMouse

    X = XMouse + Global Value A
    Y = YMouse + Global Value B

  5. #5
    Clicker Fusion 2.5 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Location
    Turku, Finland
    Posts
    1,023
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Distance between?

    Don't listen to Erik. He is so cheap!

  6. #6
    Clicker Fusion 2.5

    Join Date
    Jun 2006
    Posts
    402
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Distance between?

    Ravenius, the joke is over now. And your confusing people! [crazy]

    Isaac

Similar Threads

  1. Distance
    By ad in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 28th April 2012, 04:24 PM
  2. How to get X+Y distance?
    By PandaExplosion in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 21st November 2010, 01:24 PM
  3. Max Distance Out Of Frame
    By DarkArchonLord in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 26th May 2009, 03:29 AM
  4. Distance check bug help?
    By mobichan in forum File Archive
    Replies: 6
    Last Post: 30th January 2009, 04:33 PM
  5. Plz can sum1 help me with animation obj problem?
    By Gibbon in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 14th November 2006, 11:42 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
  •