<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: How to Drag Clock Hands in a Circle</title>
	<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands</link>
	<description>Luck is the residue of good design.</description>
	<pubDate>Wed, 19 Nov 2008 04:19:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: Cathrine</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-121113</link>
		<pubDate>Wed, 16 Jan 2008 08:57:27 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-121113</guid>
					<description>Thank you for answering David! You understood me perfectly - and I see that this one is complicated - having in mind that the code has to &quot;know&quot; how many times the Minute has passed &quot;12 o'clock&quot;. I am happy to be on your Get-To list, and thank you for very good explanations in this forum! I will follow this blog and check to see if you ever get the time to look in to it, but In the meantime I will look into some trigonometry-lessons to try to get better in understanding angles, degrees and so on... :-)</description>
		<content:encoded><![CDATA[<p>Thank you for answering David! You understood me perfectly - and I see that this one is complicated - having in mind that the code has to &#8220;know&#8221; how many times the Minute has passed &#8220;12 o&#8217;clock&#8221;. I am happy to be on your Get-To list, and thank you for very good explanations in this forum! I will follow this blog and check to see if you ever get the time to look in to it, but In the meantime I will look into some trigonometry-lessons to try to get better in understanding angles, degrees and so on&#8230; <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-120662</link>
		<pubDate>Mon, 14 Jan 2008 21:48:37 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-120662</guid>
					<description>Cathrine,

Your question is a good one!  :)  It sounds like you're asking how to make the Hour hand follow the Minute hand as the Minute hand gets dragged around the face &amp;#8212; just like a real clock &amp;#8212; is that right?  If so, the tricky part, to my thinking, is how to keep track of the Hour hand and have it &quot;remember&quot; its place.  Drag the Minute hand around once, the Hour hand moves from 1 to 2.  Drag the Minute hand around again, the Hour hand moves from 2 to 3, and so on.

I'll really have to think about this one!  I'd added your question to my Get-To list, but there are quite a few in there right now, so I'm not sure when I'll be able to answer this one specifically.</description>
		<content:encoded><![CDATA[<p>Cathrine,</p>
<p>Your question is a good one!  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   It sounds like you&#8217;re asking how to make the Hour hand follow the Minute hand as the Minute hand gets dragged around the face &mdash; just like a real clock &mdash; is that right?  If so, the tricky part, to my thinking, is how to keep track of the Hour hand and have it &#8220;remember&#8221; its place.  Drag the Minute hand around once, the Hour hand moves from 1 to 2.  Drag the Minute hand around again, the Hour hand moves from 2 to 3, and so on.</p>
<p>I&#8217;ll really have to think about this one!  I&#8217;d added your question to my Get-To list, but there are quite a few in there right now, so I&#8217;m not sure when I&#8217;ll be able to answer this one specifically.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Cathrine</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-118974</link>
		<pubDate>Wed, 09 Jan 2008 16:00:55 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-118974</guid>
					<description>David:

First of all thanks!!

Me too i am making a clock for children, but haven't found out how I can make an &quot;mcHour&quot; to properly follow the mcMinute. Actually I feel this is really tricky, because Flash doesn't use 360 degrees on the circle, but starts counting from -179,999... at the bottom of the circle.. Any tips?</description>
		<content:encoded><![CDATA[<p>David:</p>
<p>First of all thanks!!</p>
<p>Me too i am making a clock for children, but haven&#8217;t found out how I can make an &#8220;mcHour&#8221; to properly follow the mcMinute. Actually I feel this is really tricky, because Flash doesn&#8217;t use 360 degrees on the circle, but starts counting from -179,999&#8230; at the bottom of the circle.. Any tips?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-74587</link>
		<pubDate>Tue, 21 Aug 2007 18:32:28 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-74587</guid>
					<description>Ingmar,

Hey, glad to hear it.  Thanks!</description>
		<content:encoded><![CDATA[<p>Ingmar,</p>
<p>Hey, glad to hear it.  Thanks!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Ingmar Zahorsky</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-74362</link>
		<pubDate>Mon, 20 Aug 2007 23:42:23 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-74362</guid>
					<description>David, 

thank you! Your blog is awesome. I have been looking for exactly this explanation to rotate two disks. 

Best,
Ingmar</description>
		<content:encoded><![CDATA[<p>David, </p>
<p>thank you! Your blog is awesome. I have been looking for exactly this explanation to rotate two disks. </p>
<p>Best,<br />
Ingmar
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-68933</link>
		<pubDate>Thu, 02 Aug 2007 14:36:23 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-68933</guid>
					<description>Steve,

I'm thinking there must be something off with the registration points of your &lt;code&gt;mcMinute&lt;/code&gt; and &lt;code&gt;mcFace&lt;/code&gt; clips.  I rebuilt this just now and the hand rotates to exactly where I drag it.

Can you verify that each clip is on its own layer and the face clip's registration is in its upper left, while the hand clip's registration is centered on its pivot end?</description>
		<content:encoded><![CDATA[<p>Steve,</p>
<p>I&#8217;m thinking there must be something off with the registration points of your <code>mcMinute</code> and <code>mcFace</code> clips.  I rebuilt this just now and the hand rotates to exactly where I drag it.</p>
<p>Can you verify that each clip is on its own layer and the face clip&#8217;s registration is in its upper left, while the hand clip&#8217;s registration is centered on its pivot end?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Steve</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-68930</link>
		<pubDate>Thu, 02 Aug 2007 14:24:36 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-68930</guid>
					<description>David:

Great blog!  First time visiting and I was looking for something exactly like this.  However, I have a question.

1.  The direction of the hands seem to be quite &quot;loose&quot;.  How would I go tightening up the direction of the hands so if I move to 12:00 on the clock, my hands point to there?  I am designing this for children, so the movements have to be a little tighter.  The way it is currently written, the movement would be quite frustrating.
Thanks.</description>
		<content:encoded><![CDATA[<p>David:</p>
<p>Great blog!  First time visiting and I was looking for something exactly like this.  However, I have a question.</p>
<p>1.  The direction of the hands seem to be quite &#8220;loose&#8221;.  How would I go tightening up the direction of the hands so if I move to 12:00 on the clock, my hands point to there?  I am designing this for children, so the movements have to be a little tighter.  The way it is currently written, the movement would be quite frustrating.<br />
Thanks.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-43780</link>
		<pubDate>Wed, 09 May 2007 02:29:49 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-43780</guid>
					<description>paczor,

Cool tweak!  Good stuff.  :)</description>
		<content:encoded><![CDATA[<p>paczor,</p>
<p>Cool tweak!  Good stuff.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: paczor</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-43124</link>
		<pubDate>Sun, 06 May 2007 22:01:16 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-43124</guid>
					<description>Hi David!
Thanks for the code. I used it in my project in which clock's hand follows mouse. I would like to add little note on it:
my movie is quite small (185x185px) so clock's hand do not follow mouse correctly - if I resize movie to allow mouse to go far away clock's face everything is OK.
The dirty hack for it is to add some extra values to both mouse's cooordinates:

 var angle:Number = Math.atan2(
      (mcFace._ymouse + 100) - mcFace._height / 2,
      (mcFace._xmouse + 100) - mcFace._width / 2
    );

It works because function &quot;thinks&quot; that mouse is 100px further from clock. :)

Thanks again, you are doing great job!</description>
		<content:encoded><![CDATA[<p>Hi David!<br />
Thanks for the code. I used it in my project in which clock&#8217;s hand follows mouse. I would like to add little note on it:<br />
my movie is quite small (185&#215;185px) so clock&#8217;s hand do not follow mouse correctly - if I resize movie to allow mouse to go far away clock&#8217;s face everything is OK.<br />
The dirty hack for it is to add some extra values to both mouse&#8217;s cooordinates:</p>
<p> var angle:Number = Math.atan2(<br />
      (mcFace._ymouse + 100) - mcFace._height / 2,<br />
      (mcFace._xmouse + 100) - mcFace._width / 2<br />
    );</p>
<p>It works because function &#8220;thinks&#8221; that mouse is 100px further from clock. <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Thanks again, you are doing great job!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: olowekk</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-42612</link>
		<pubDate>Fri, 04 May 2007 10:05:24 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-42612</guid>
					<description>Certainly:),  the kind of clock hand motion I want to achieve may be best observed in code I placed above (var drag:Number =20…) I want to slow down the clock hand movement while it approaches a mouse pointer. I don’t want the clock hand to follow the cursor immediately it changes its position. 
(as if the clock hand was sleepy and could not catch up with the mouse pointer). When there’s no mouse movement the clock hand should keep rotating.
The word ‘elastic’ may not have suggested my point best last time I mentioned it. Here’s code I used and want to change:


mcMinute.onEnterFrame = function() {
  this._rotation += 0.1;
  this.onMouseMove = function() {
    
	var angle:Number = Math.atan2(
      mcFace._ymouse - mcFace._height / 2,
      mcFace._xmouse - mcFace._width / 2
    );
    this._rotation = (angle * 180 / Math.PI) + 90;
  };
};
mcMinute.onRelease = function() {
  delete this.onMouseMove;
};
mcMinute.onReleaseOutside = mcMinute.onRelease;</description>
		<content:encoded><![CDATA[<p>Certainly:),  the kind of clock hand motion I want to achieve may be best observed in code I placed above (var drag:Number =20…) I want to slow down the clock hand movement while it approaches a mouse pointer. I don’t want the clock hand to follow the cursor immediately it changes its position.<br />
(as if the clock hand was sleepy and could not catch up with the mouse pointer). When there’s no mouse movement the clock hand should keep rotating.<br />
The word ‘elastic’ may not have suggested my point best last time I mentioned it. Here’s code I used and want to change:</p>
<p>mcMinute.onEnterFrame = function() {<br />
  this._rotation += 0.1;<br />
  this.onMouseMove = function() {</p>
<p>	var angle:Number = Math.atan2(<br />
      mcFace._ymouse - mcFace._height / 2,<br />
      mcFace._xmouse - mcFace._width / 2<br />
    );<br />
    this._rotation = (angle * 180 / Math.PI) + 90;<br />
  };<br />
};<br />
mcMinute.onRelease = function() {<br />
  delete this.onMouseMove;<br />
};<br />
mcMinute.onReleaseOutside = mcMinute.onRelease;
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
