Jump to content


Rotation


  • You cannot reply to this topic
4 replies to this topic

#1 FlashGameboy

    Young Padawan

  • Members
  • Pip
  • 139 posts
  • Gender:Male
  • Location:Somewhere over the rainbow
  • Interests:Mostly flash but im trying to work on Maya and some<br />signiture design

Posted 25 December 2005 - 04:20 PM

My problem is that i want an stick to rotate around on a preset point until it points to the
cursor I have worked on it for 2 hours and i still can't get it can anyone offer a little coding help? :lol:

Also what is _rotation? and would that help with this :wacko:

Edited by FlashGameboy, 25 December 2005 - 04:31 PM.


#2 funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 26 December 2005 - 03:55 PM

hi there, maybe this code can help you:

onEnterFrame = function(){
var dx = _xmouse - arrow._x;
var dy = _ymouse - arrow._y;
var radians = Math.atan2(dy,dx);
arrow._rotation = radians * 180 / Math.PI;
}

arrow is the instace name of a movieclip :ph34r:

Cheers
Funkysoul

#3 FlashGameboy

    Young Padawan

  • Members
  • Pip
  • 139 posts
  • Gender:Male
  • Location:Somewhere over the rainbow
  • Interests:Mostly flash but im trying to work on Maya and some<br />signiture design

Posted 28 December 2005 - 11:35 AM

Your a genius thanks :)

#4 FlashGameboy

    Young Padawan

  • Members
  • Pip
  • 139 posts
  • Gender:Male
  • Location:Somewhere over the rainbow
  • Interests:Mostly flash but im trying to work on Maya and some<br />signiture design

Posted 12 January 2006 - 07:50 PM

The code worked great. Since my coding level isn't that high i couldn't
manipulate it so that the preset point is at one end of the stick. Could you offer
a little more coding advice. Sorry about the hassle

:) :glare: :P

#5 funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 13 January 2006 - 05:01 AM

I don't really understand what you want now, with the code I've provided you, you should be able to create a stick where the anchor point follows the mouse.
Maybe post a link to your fla or even to a example of what you want to achieve would help a lot.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users