

































<?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>Tue, 07 Feb 2012 20:27:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: Joe Morgan</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-473675</link>
		<pubDate>Mon, 02 Aug 2010 21:49:43 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-473675</guid>
					<description>Simple piece of code. Thank you. Need to find a way to slow it down a bit as I'm trying to place a nice trail on it (had to duplicate the mcMinute mc and gave it export name 'mcMinutecopy'. You get a nice effect if you uncomment the x and y scale code):

var fade:Number = 0.95;
var counter:Number = 1;

mcMinute.onPress = function() {
  this.onMouseMove = function() {
    /*var angle:Number = Math.atan2(
      mcFace._ymouse - mcFace._height / 2,
      mcFace._xmouse - mcFace._width / 2
    );*/
	var angle:Number = Math.atan2(
		(mcFace._ymouse + 100) - mcFace._height / 2,
		(mcFace._xmouse + 100) - mcFace._width / 2
	);
    this._rotation = (angle * 180 / Math.PI) + 90;
	
	var copy:MovieClip = attachMovie(&quot;mcMinutecopy&quot;, &quot;copy&quot; + counter, counter++);
	copy._x = this._x;
	copy._y = this._y;
	copy._xscale = 200;
	copy._yscale = 200;
	copy._rotation = this._rotation;
	copy.onEnterFrame = function() {
		this._alpha *= _root.fade;
		//this.glowpart._xscale *= _root.fade;
		//this.glowpart._yscale *= _root.fade;
		if (this._alpha </description>
		<content:encoded><![CDATA[<p>Simple piece of code. Thank you. Need to find a way to slow it down a bit as I&#8217;m trying to place a nice trail on it (had to duplicate the mcMinute mc and gave it export name &#8216;mcMinutecopy&#8217;. You get a nice effect if you uncomment the x and y scale code):</p>
<p>var fade:Number = 0.95;<br />
var counter:Number = 1;</p>
<p>mcMinute.onPress = function() {<br />
  this.onMouseMove = function() {<br />
    /*var angle:Number = Math.atan2(<br />
      mcFace._ymouse - mcFace._height / 2,<br />
      mcFace._xmouse - mcFace._width / 2<br />
    );*/<br />
	var angle:Number = Math.atan2(<br />
		(mcFace._ymouse + 100) - mcFace._height / 2,<br />
		(mcFace._xmouse + 100) - mcFace._width / 2<br />
	);<br />
    this._rotation = (angle * 180 / Math.PI) + 90;</p>
<p>	var copy:MovieClip = attachMovie(&#8221;mcMinutecopy&#8221;, &#8220;copy&#8221; + counter, counter++);<br />
	copy._x = this._x;<br />
	copy._y = this._y;<br />
	copy._xscale = 200;<br />
	copy._yscale = 200;<br />
	copy._rotation = this._rotation;<br />
	copy.onEnterFrame = function() {<br />
		this._alpha *= _root.fade;<br />
		//this.glowpart._xscale *= _root.fade;<br />
		//this.glowpart._yscale *= _root.fade;<br />
		if (this._alpha
</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-404612</link>
		<pubDate>Thu, 23 Jul 2009 13:57:17 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-404612</guid>
					<description>koop,

You're welcome.  :)</description>
		<content:encoded><![CDATA[<p>koop,</p>
<p>You&#8217;re welcome.  <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: koop</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-404086</link>
		<pubDate>Sun, 19 Jul 2009 10:26:51 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-drag-clock-hands#comment-404086</guid>
					<description>thanks!</description>
		<content:encoded><![CDATA[<p>thanks!
</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-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>
</channel>
</rss>

