A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: calculate mouse locatiom

  1. #1
    Member
    Join Date
    Jul 2000
    Posts
    87
    Hi everybody!!
    I need the eye to follow the mouse., that simple.,
    little demo:http://www.geocities.com/iliap999/flashwork/myzoom.html
    but i don't want it just to be a dragable MC(personal reasons), I did it in director time ago , look something like this(for the left eye)

    set h = 300 -- the mouseh
    set v = 241 -- the mousev
    set l = sqrt(v*v + h*h)
    set the loch of sprite 7 = 300 - 12*h/l
    set the locv of sprite 7 = 241 - 12*v/l
    not familiar with flash yet that much to do it.,
    any sujestions will be apriciated
    Ilia



  2. #2
    Senior Member
    Join Date
    Jun 2000
    Posts
    337
    Eya,

    Sorry, but it just isn't possible in flash4 without a draggable MC. You should make a dragable MC and trace it's x and y. That's the only way in flash4.

    LTrZ!
    DamnGzM.

  3. #3
    Senior Member
    Join Date
    Jun 2000
    Posts
    337
    Eey again,

    Since you're familair or perhaps an expert on director, there is a way around. You could actually get the x and y using your method in director, and passing them as variables to the swf which you should use as a castmember in director.

    DamnGzM.

  4. #4
    Member
    Join Date
    Jul 2000
    Posts
    87

    no director for me anymore ., flash. flash and flash., besides, final product is .swf, so can't really use your advice., iam sure it should be some workaround there., some of those lovely flash tricks not necessary hard coded actionscript.. well, i'll play more with it and see what i can do..
    Thanks again
    Ilia
    Originally posted by DamnGzM
    Eey again,

    Since you're familair or perhaps an expert on director, there is a way around. You could actually get the x and y using your method in director, and passing them as variables to the swf which you should use as a castmember in director.

    DamnGzM.

  5. #5
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    Create a new movieclip and then inside this movieclip on the first frame put:
    Start Drag("")

    Then On the Second frame put:
    set variable: "/:my_x" = getProperty("",_x)
    set varaible: "/:my_y" = Getproperty("",_y)

    then on the third frame put:

    Go To And Play (2)

    then to display the mouses x and y co-ordinates create two new textfields call one "my_x" and the other "my_y"
    Put the movielcip and the two textfiled son the main timeline and off we go!!

    Hope that Helps!!

    Regards FlashGuru

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