<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>DanWasHere.com Blog - Freelance Flash Development</title>
	<atom:link href="http://dansearle.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dansearle.wordpress.com</link>
	<description>Following the events at DanWasHere.com</description>
	<lastBuildDate>Thu, 19 May 2011 10:02:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='dansearle.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>DanWasHere.com Blog - Freelance Flash Development</title>
		<link>http://dansearle.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dansearle.wordpress.com/osd.xml" title="DanWasHere.com Blog - Freelance Flash Development" />
	<atom:link rel='hub' href='http://dansearle.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Moving!</title>
		<link>http://dansearle.wordpress.com/2010/03/15/moving/</link>
		<comments>http://dansearle.wordpress.com/2010/03/15/moving/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 20:31:21 +0000</pubDate>
		<dc:creator>dansearle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[moving blog]]></category>

		<guid isPermaLink="false">http://dansearle.wordpress.com/2010/03/15/moving/</guid>
		<description><![CDATA[I&#8217;m moving this blog to my own domain: http://blog.danwashere.com thanks!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansearle.wordpress.com&amp;blog=8198916&amp;post=46&amp;subd=dansearle&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m moving this blog to my own domain:<br />
<a href="http://blog.danwashere.com">http://blog.danwashere.com</a><br />
thanks!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dansearle.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dansearle.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dansearle.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dansearle.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dansearle.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dansearle.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dansearle.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dansearle.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dansearle.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dansearle.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dansearle.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dansearle.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dansearle.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dansearle.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansearle.wordpress.com&amp;blog=8198916&amp;post=46&amp;subd=dansearle&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dansearle.wordpress.com/2010/03/15/moving/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/09d8315f8e420508a7a49f15d7e33b59?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dansearle</media:title>
		</media:content>
	</item>
		<item>
		<title>Input TextFields &#8211; auto select all text</title>
		<link>http://dansearle.wordpress.com/2010/03/05/input-textfields-auto-select-all-text/</link>
		<comments>http://dansearle.wordpress.com/2010/03/05/input-textfields-auto-select-all-text/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 23:01:11 +0000</pubDate>
		<dc:creator>dansearle</dc:creator>
				<category><![CDATA[Flash Tips & Notes]]></category>
		<category><![CDATA[FocusEvent]]></category>
		<category><![CDATA[FOCUS_IN]]></category>
		<category><![CDATA[FOCUS_OUT]]></category>
		<category><![CDATA[highlight]]></category>
		<category><![CDATA[Input]]></category>
		<category><![CDATA[KEY_FOCUS_CHANGE]]></category>
		<category><![CDATA[selectionBeginIndex]]></category>
		<category><![CDATA[selectionEndIndex]]></category>
		<category><![CDATA[setSelection]]></category>
		<category><![CDATA[TextField]]></category>

		<guid isPermaLink="false">http://dansearle.wordpress.com/?p=40</guid>
		<description><![CDATA[Sometimes you want to have all the text in an input field selected when the user clicks on the field &#8211; this makes it easier to enter data quickly on certain forms, particularly if the fields are pre-filled. But it&#8217;s &#8230; <a href="http://dansearle.wordpress.com/2010/03/05/input-textfields-auto-select-all-text/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansearle.wordpress.com&amp;blog=8198916&amp;post=40&amp;subd=dansearle&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes you want to have all the text in an input field selected when the user clicks on the field &#8211; this makes it easier to enter data quickly on certain forms, particularly if the fields are pre-filled.<br />
But it&#8217;s not so easy to do without breaking the standard functionality of the input field. This code hopefully does it without breaking anything, and without compromising on the new functionality.</p>
<p>Put this demo script in Frame 1 of a fresh FLA and give it a whirl:<br />
<code>// Create some text TextFields<br />
var n:Number;<br />
var tf:TextField;<br />
var tfmt:TextFormat = new TextFormat("_sans", 20);<br />
for(n = 0; n  2){<br />
		tf.text = "Test text for number " + (n+1);<br />
	}</p>
<p>	tf.addEventListener(FocusEvent.FOCUS_IN, handleFocusIn);<br />
}</p>
<p>// Listen on the stage for the KEY_FOCUS_CHANGE event so that we can handle<br />
// when the user tabs into a TextField.<br />
addEventListener(FocusEvent.KEY_FOCUS_CHANGE, handleKeyFocusChange);</p>
<p>function handleKeyFocusChange($e:FocusEvent):void {<br />
	// If the user tabs to a textfield, cancel the focus in handler so that<br />
	// subsequent mouse clicks in that field DON'T highlight the whole field.<br />
	if($e.relatedObject is TextField){<br />
		var tf:TextField = TextField($e.relatedObject);<br />
		tf.removeEventListener(FocusEvent.FOCUS_IN, handleFocusIn);<br />
		tf.addEventListener(FocusEvent.FOCUS_OUT, handleFocusOut);<br />
	}<br />
}</p>
<p>function handleMouseUp($e:MouseEvent):void {<br />
	var tf:TextField = TextField($e.target);<br />
	if(tf.selectionBeginIndex == tf.selectionEndIndex){<br />
		// If the user hasn't dragged to select text already,<br />
		// select the whole text field.<br />
		tf.setSelection(0, tf.text.length);<br />
	}<br />
	tf.removeEventListener(MouseEvent.MOUSE_UP, handleMouseUp);<br />
}<br />
function handleFocusIn($e:Event):void {<br />
	var tf:TextField = TextField($e.target);<br />
	tf.addEventListener(MouseEvent.MOUSE_UP, handleMouseUp);<br />
	tf.addEventListener(FocusEvent.FOCUS_OUT, handleFocusOut);<br />
}<br />
function handleFocusOut($e:Event):void {<br />
	var tf:TextField = TextField($e.target);<br />
	tf.addEventListener(FocusEvent.FOCUS_IN, handleFocusIn);<br />
	tf.removeEventListener(FocusEvent.FOCUS_OUT, handleFocusOut);<br />
}<br />
</code></p>
<p>Basically it works by listening for the FOCUS_IN event on each TextField &#8211; when it gets it, it then listens for the MOUSE_UP event that normally follows. When that event happens it checks if a selection has been made (which happens when the user holds and drags to highlight characters in the field), and if not it highlights the whole field. Now since it&#8217;s no longer listening for the FOCUS_IN nor the MOUSE_UP events, it lets the user click again in the same field and it won&#8217;t highlight it all again &#8211; this is important to make it easier for the user to work with the field.<br />
When the user moves away from the field, the FOCUS_OUT event fires, the TextField catches it and starts listening for the FOCUS_IN event again.</p>
<p>All this is fine unless the user uses the keyboard to TAB into the field &#8211; if the user tabs into the field, and then uses the mouse to select characters, we don&#8217;t want the whole field to highlight again, so to prevent this we have the stage listen out for the FocusEvent.KEY_FOCUS_CHANGE event. When this event fires we check if the object the focus is moving to (the relatedObject property) is a TextField, if it is then we remove the listener on that field for the MOUSE_UP event &#8211; this disables the new highlighting feature. To make sure it works again properly when the user moves out again, we start it listening for the FOCUS_OUT event.</p>
<p>Have I typed enough now? <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  To see it in action:<br />
<a href="http://www.danwashere.com/flash_files/input_textfield/special_input_textfield.html">Auto Highlighting TextField</a><br />
and<br />
<a href="http://www.danwashere.com/flash_files/input_textfield/special_input_textfield.fla">download the FLA</a> (CS4)</p>
<p>Oh and this all works because of the order the events come in as. When you use the mouse to focus on an Input field it goes like this:<br />
FocusEvent.FOCUS_IN<br />
MouseEvent.MOUSE_UP</p>
<p>when you use the keyboard to tab in:<br />
FocusEvent.KEY_FOCUS_CHANGE<br />
FocusEvent.FOCUS_IN<br />
MouseEvent.MOUSE_UP</p>
<p>If this comes in useful at all, please leave a comment?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dansearle.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dansearle.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dansearle.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dansearle.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dansearle.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dansearle.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dansearle.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dansearle.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dansearle.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dansearle.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dansearle.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dansearle.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dansearle.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dansearle.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansearle.wordpress.com&amp;blog=8198916&amp;post=40&amp;subd=dansearle&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dansearle.wordpress.com/2010/03/05/input-textfields-auto-select-all-text/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/09d8315f8e420508a7a49f15d7e33b59?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dansearle</media:title>
		</media:content>
	</item>
		<item>
		<title>AlivePDF and Popup Blockers</title>
		<link>http://dansearle.wordpress.com/2010/02/26/alivepdf-and-popup-blockers/</link>
		<comments>http://dansearle.wordpress.com/2010/02/26/alivepdf-and-popup-blockers/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 00:34:06 +0000</pubDate>
		<dc:creator>dansearle</dc:creator>
				<category><![CDATA[Flash Tips & Notes]]></category>
		<category><![CDATA[AlivePDF]]></category>
		<category><![CDATA[blocker]]></category>
		<category><![CDATA[ExternalInterface]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[navigateToURL]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Pop-up]]></category>
		<category><![CDATA[popup]]></category>

		<guid isPermaLink="false">http://dansearle.wordpress.com/?p=34</guid>
		<description><![CDATA[I&#8217;ve been doing some headscratching and googling the last few days over a problem I had when using http://www.alivepdf.org/ to turn a movieclip into a PDF. The class is great, and gets you a PDF no problem, and when testing &#8230; <a href="http://dansearle.wordpress.com/2010/02/26/alivepdf-and-popup-blockers/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansearle.wordpress.com&amp;blog=8198916&amp;post=34&amp;subd=dansearle&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing some headscratching and googling the last few days over a problem I had when using <a href="http://www.alivepdf.org/">http://www.alivepdf.org/</a> to turn a movieclip into a PDF. The class is great, and gets you a PDF no problem, and when testing in Chrome all was fine, but when I tried it in IE or Firefox, the native popup blockers caused it to stop working.<br />
The problem is that navigateToURL() always triggers the blockers, and AlivePDF uses it when you call the PDF.save method with Method.REMOTE, which is what you do if you want it to create the PDF and open it in a new window.<br />
So how to get around that? Well firstly you need to avoid using navigateToURL(). Some googling turned up this code (found here <a href="http://www.blogs.abeazam.com/dev/?p=37">http://www.blogs.abeazam.com/dev/?p=37</a>):<br />
<code>//set the desired URL here<br />
var url_str:String = "http://www.yoururl.com"</code></p>
<p><code> </code></p>
<p><code> //checks to see if the browser has JS on and<br />
//if ExternalInterface is compatible with the browser<br />
if (ExternalInterface.available)<br />
{<br />
//calls the JS function "window.open" in a new window<br />
ExternalInterface.call( "window.open", url_str, "_blank" );<br />
}<br />
else<br />
{<br />
//the fall back call is "navigateToURL"<br />
var urlRequest:URLRequest = new URLRequest(url_str);<br />
navigateToURL(urlRequest,"_blank");<br />
}</code><br />
But there&#8217;s a problem &#8211; AlivePDF needs to use a POST request to send the PDF bytearray &#8211; that&#8217;s not possible with the ExternalInterface.call alternative.</p>
<p>So the solution is to split up the PHP script into two: The first, create_pdf.php receives the bytearray POST and stores it in a session var, all it returns is ok or fail. The second script, fetch_pdf.php takes no parameters, and just outputs a PDF based on whatever&#8217;s in the session.<br />
To make that work you need to change the call to PDF.save so it uses Method.LOCAL, and saves the return value, which is the PDF bytearray. Then you send that bytearray via POST to the create_pdf.php script, when that returns you can call the fetch_pdf.php script to actually get it.</p>
<p>But now there&#8217;s another problem &#8211; if you wait for a COMPLETE event to tell you when create_pdf.php has finished, and then try to load fetch_pdf.php &#8211; you&#8217;ll still trigger the popup blocker, because now you&#8217;re no longer calling the script as a result of a mouse click. So you have to add a little interface and button to the app to allow the user to click to fetch the PDF when it&#8217;s ready.</p>
<p>So to sum up, here&#8217;s how it goes:</p>
<ol>
<li>User requests a PDF.</li>
<li>Use PDF.save(Method.LOCAL) and store the return PDF bytearray.</li>
<li>Use URLLoader to send that bytearray to the create_pdf.php script, listen for the COMPLETE event.</li>
<li>When the COMPLETE event triggers, show the user a button to allow them to fetch the PDF.</li>
<li>When the user clicks the button, use the above workaround with ExternalInterface.call to load fetch_pdf-php.</li>
</ol>
<p>Here are the two PHP scripts.<br />
create_pdf.php<br />
<code>	session_start();</p>
<p>	$_SESSION['pdf_data'] = '';</p>
<p>	// Receive the data for a PDF, store it in a session so it can be converted by a<br />
	// subsequent call to the fetch_pdf.php script.</p>
<p>	if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) {<br />
		// get bytearray<br />
		$pdf = $GLOBALS["HTTP_RAW_POST_DATA"];<br />
		$_SESSION['pdf_data'] = $GLOBALS["HTTP_RAW_POST_DATA"];<br />
		echo 'ok';<br />
	} else {<br />
		echo 'error';<br />
	}<br />
</code></p>
<p>fetch_pdf.php<br />
<code>/*<br />
** Return the PDF that was previously created and stored in the user's session.<br />
*/<br />
	session_start();</p>
<p>	//echo "HEADERS SENT? " . (headers_sent($file, $line) ? "YES" : "NO") . ", " . $file . ", line: " . $line;<br />
	if ( isset ( $_SESSION['pdf_data'] ) &amp;&amp; $_SESSION['pdf_data'] != '' ) {<br />
		header("Cache-Control: public");<br />
		header("Content-Description: File Transfer");<br />
		header("Content-Disposition: attachment; filename=ybs_cover_choices.pdf");<br />
		header("Content-Type: application/pdf");<br />
		header("Content-Transfer-Encoding: binary");</p>
<p>		echo $_SESSION['pdf_data'];<br />
	} else {<br />
		echo 'An error occured.';<br />
	}<br />
</code><br />
Hope that helps someone else.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dansearle.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dansearle.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dansearle.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dansearle.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dansearle.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dansearle.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dansearle.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dansearle.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dansearle.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dansearle.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dansearle.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dansearle.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dansearle.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dansearle.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansearle.wordpress.com&amp;blog=8198916&amp;post=34&amp;subd=dansearle&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dansearle.wordpress.com/2010/02/26/alivepdf-and-popup-blockers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/09d8315f8e420508a7a49f15d7e33b59?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dansearle</media:title>
		</media:content>
	</item>
		<item>
		<title>What am I clicking on?</title>
		<link>http://dansearle.wordpress.com/2009/11/11/what-am-i-clicking-on/</link>
		<comments>http://dansearle.wordpress.com/2009/11/11/what-am-i-clicking-on/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 11:00:12 +0000</pubDate>
		<dc:creator>dansearle</dc:creator>
				<category><![CDATA[Flash Tips & Notes]]></category>

		<guid isPermaLink="false">http://dansearle.wordpress.com/?p=24</guid>
		<description><![CDATA[Sometimes when you have a complicated layout with lots of overlapping clips, masks, transparencies and such, the mouse just doesn&#8217;t seem to be hitting what&#8217;s directly under it. Your button won&#8217;t click. There&#8217;s something invisible between the mouse and your &#8230; <a href="http://dansearle.wordpress.com/2009/11/11/what-am-i-clicking-on/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansearle.wordpress.com&amp;blog=8198916&amp;post=24&amp;subd=dansearle&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes when you have a complicated layout with lots of overlapping clips, masks, transparencies and such, the mouse just doesn&#8217;t seem to be hitting what&#8217;s directly under it. Your button won&#8217;t click. There&#8217;s something invisible between the mouse and your button and you can&#8217;t figure out what it is.</p>
<p>The thing to do here is to add a listener to the stage. All mouse events end up at the stage eventually, and when they get there they tell us what was clicked:</p>
<pre> stage.addEventListener(MouseEvent.CLICK, handleStageClick);
..........
private function handleStageClick($e:MouseEvent):void {
  var tmpDo:DisplayObject = DisplayObject($e.target);
  var path:String = $e.target.name;
  while (tmpDo.parent &amp;&amp; tmpDo.parent.name) {
    path = tmpDo.parent.name + "." + path;
    tmpDo = tmpDo.parent;
  }
  trace("CLICK: " + path);
}
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dansearle.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dansearle.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dansearle.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dansearle.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dansearle.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dansearle.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dansearle.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dansearle.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dansearle.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dansearle.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dansearle.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dansearle.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dansearle.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dansearle.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansearle.wordpress.com&amp;blog=8198916&amp;post=24&amp;subd=dansearle&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dansearle.wordpress.com/2009/11/11/what-am-i-clicking-on/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/09d8315f8e420508a7a49f15d7e33b59?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dansearle</media:title>
		</media:content>
	</item>
		<item>
		<title>BitmapData &#8211; turning the image to greyscale</title>
		<link>http://dansearle.wordpress.com/2009/09/23/bitmapdata-turning-the-image-to-greyscale/</link>
		<comments>http://dansearle.wordpress.com/2009/09/23/bitmapdata-turning-the-image-to-greyscale/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 16:29:21 +0000</pubDate>
		<dc:creator>dansearle</dc:creator>
				<category><![CDATA[Flash Tips & Notes]]></category>
		<category><![CDATA[greyscale grayscale bitmapdata bitmap]]></category>

		<guid isPermaLink="false">http://dansearle.wordpress.com/?p=19</guid>
		<description><![CDATA[Here&#8217;s a useful tidbit I picked up from here: http://www.adobe.com/devnet/flash/articles/matrix_transformations_print.html How to turn a colour bitmapdata into greyscale. // Turn the object graphics to greyscale. var matrix:Array = new Array(); matrix = matrix.concat([0.33, 0.33, 0.33, 0, 0]); // red matrix &#8230; <a href="http://dansearle.wordpress.com/2009/09/23/bitmapdata-turning-the-image-to-greyscale/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansearle.wordpress.com&amp;blog=8198916&amp;post=19&amp;subd=dansearle&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a useful tidbit I picked up from here:<br />
<a href="http://www.adobe.com/devnet/flash/articles/matrix_transformations_print.html">http://www.adobe.com/devnet/flash/articles/matrix_transformations_print.html</a></p>
<p>How to turn a colour bitmapdata into greyscale.<br />
<code><br />
// Turn the object graphics to greyscale.<br />
var matrix:Array = new Array();<br />
matrix = matrix.concat([0.33, 0.33, 0.33, 0, 0]); // red<br />
matrix = matrix.concat([0.33, 0.33, 0.33, 0, 0]); // green<br />
matrix = matrix.concat([0.33, 0.33, 0.33, 0, 0]); // blue<br />
matrix = matrix.concat([0, 0, 0, 1, 0]); // alpha<br />
</code><code><br />
var filter:ColorMatrixFilter = new ColorMatrixFilter(matrix);<br />
</code><code><br />
// Note, bdItem has already been created with an image.<br />
bdItem.applyFilter(bdItem, new Rectangle(0, 0, bdItem.width, bdItem.height), new Point(0, 0), filter);</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dansearle.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dansearle.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dansearle.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dansearle.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dansearle.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dansearle.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dansearle.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dansearle.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dansearle.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dansearle.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dansearle.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dansearle.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dansearle.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dansearle.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansearle.wordpress.com&amp;blog=8198916&amp;post=19&amp;subd=dansearle&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dansearle.wordpress.com/2009/09/23/bitmapdata-turning-the-image-to-greyscale/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/09d8315f8e420508a7a49f15d7e33b59?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dansearle</media:title>
		</media:content>
	</item>
		<item>
		<title>Spirals in motion</title>
		<link>http://dansearle.wordpress.com/2009/06/16/first/</link>
		<comments>http://dansearle.wordpress.com/2009/06/16/first/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 11:51:27 +0000</pubDate>
		<dc:creator>dansearle</dc:creator>
				<category><![CDATA[Flash Experiments]]></category>
		<category><![CDATA[colour]]></category>
		<category><![CDATA[maths]]></category>
		<category><![CDATA[motion]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[rgb]]></category>
		<category><![CDATA[spiral]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Well here it is, the first post&#8230; The idea of this blog is to make my Flash work, the portfolio pieces and experiments, more available. My site will soon get a redesign using a Papervision interface, which while cool in &#8230; <a href="http://dansearle.wordpress.com/2009/06/16/first/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansearle.wordpress.com&amp;blog=8198916&amp;post=1&amp;subd=dansearle&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Well here it is, the first post&#8230;</p>
<p>The idea of this blog is to make my Flash work, the portfolio pieces and experiments, more available. <a href="http://www.danwashere.com">My site</a> will soon get a redesign using a Papervision interface, which while cool in many ways will make it a little harder for people to find my content, so this blog should hopefully remedy that. And also provide you with a way to give me feedback on things.</p>
<p>So I&#8217;ll start of with a random one&#8230; this was always one of my favourite experiments but I&#8217;ve yet to find a use for it, so it can kick off the blog <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div id="attachment_8" class="wp-caption alignnone" style="width: 310px"><a href="http://www.danwashere.com/flash_files/spirals_in_motion_v1.swf"><img class="size-medium wp-image-8" title="danwashere flash spirals in motion" src="http://dansearle.files.wordpress.com/2009/06/danwashere_flash_spirals_in_motion.jpg?w=300&#038;h=300" alt="Spirals in Motion" width="300" height="300" /></a><p class="wp-caption-text">Spirals in Motion</p></div>
<p>As is usual in my experiments, roll your mouse over the screen to interact with the changing patterns.</p>
<p>It was written way back when in AS1, set your background to black and stick this in frame 1:</p>
<pre><code>drawCircle = function (x, y, r) {
	var angleDelta = 45*(Math.PI/180), rx, ry, ex, ey;
	var regDist = r/Math.cos(angleDelta/2);
	var angle = 0;
	this.moveTo(x+r, y);
	for (var i = 0; i&lt;8; i++) {
		 angle += angleDelta;
		 rx = x+Math.cos(angle-(angleDelta/2))*(regDist);
		 ry = y+Math.sin(angle-(angleDelta/2))*(regDist);
		 ex = x+Math.cos(angle)*r;
		 ey = y+Math.sin(angle)*r;
		 this.curveTo(rx, ry, ex, ey);
	}
}

var k = 0.14;
var friction = 0.825;
var cx = Stage.width/2;
var cy = Stage.height/2;
var ox = cx;
var oy = cy;
var numBranches = 3;
var numNodes = 30; // Number of circles per branch
var nodes = [];
// Set up colours
var col = Math.random()*Math.PI*2;
var colInc = 0.1;
// Create the circles
for(n=0, z=1; n&lt;numBranches; n++){
	nodes.push(new Array());
	for(var m=0; m&lt;numNodes; m++, z++){
		nodes[n].push(thisNode =
			this.createEmptyMovieClip(&quot;mc_&quot;+z, (m*numBranches)+n));
		// Initally all are white, this is adjusted later
		thisNode.beginFill(0xffffff);
		drawCircle.apply(thisNode, [0, 0, 220 * (1-(m/numNodes))]);
		thisNode.endFill();
		thisNode.thisCol = new Color(thisNode);
	}
}
// Localise Math functions for better performance.
this.sin = Math.sin;
this.cos = Math.cos;
this.abs = Math.abs;
this.createEmptyMovieClip(&quot;border&quot;, z);
this.border.lineStyle(1, 0xAAAAAA);
this.border.lineTo(Stage.width-1, 0);
this.border.lineTo(Stage.width-1, Stage.height-1);
this.border.lineTo(0, Stage.height-1);
this.border.lineTo(0, 0);
this.onEnterFrame = function(){
	var thisCol, nRatio, r, g, b, rDone, gDone, bDone, rInc, gInc, bInc;
	var dx = ox - cx;
	var dy = oy - cy;
	var xRatio = dx/cx;
	var yRatio = dy/cy;
	var radInc = xRatio * -7;
	var thetaInc = yRatio * 0.05;
	var thetaMod = xRatio * 1.5;
	col += colInc;
	for(var n=0; n&lt;numBranches; n++){
		nRatio = n/numBranches;
		theta = thetaMod + ((Math.PI*2)*nRatio);
		thisCol = col + ((Math.PI*2)*nRatio);
		rDone = this.abs(0x88 + (this.sin(thisCol))*0x77);
		gDone = this.abs(0x88 + (this.sin(1.5 + thisCol))*0x77);
		bDone = this.abs(0x88 + (this.sin(3 + thisCol))*0x77);
		rInc = rDone / numNodes;
		gInc = gDone / numNodes;
		bInc = bDone / numNodes;
		r = g = b = 0;
		for(var m=0, rad=80; m&lt;numNodes; m++){
			theta += thetaInc;
			rad += radInc;
			thisNode = nodes[n][m];
			thisNode._x = cx+(this.cos(theta) * rad);
			thisNode._y = cy+(this.sin(theta) * rad);
			r += rInc;
			g += gInc;
			b += bInc;
			thisNode.thisCol.setRGB(r&lt;&lt;16 | g&lt;&lt;8 | b);
		}
	}
	vx = (vx + ((_xmouse - ox) * k)) * friction;
	vy = (vy + ((_ymouse - oy) * k)) * friction;
	ox += vx;
	oy += vy;
}</code></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dansearle.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dansearle.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dansearle.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dansearle.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dansearle.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dansearle.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dansearle.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dansearle.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dansearle.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dansearle.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dansearle.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dansearle.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dansearle.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dansearle.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansearle.wordpress.com&amp;blog=8198916&amp;post=1&amp;subd=dansearle&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dansearle.wordpress.com/2009/06/16/first/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/09d8315f8e420508a7a49f15d7e33b59?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dansearle</media:title>
		</media:content>

		<media:content url="http://dansearle.files.wordpress.com/2009/06/danwashere_flash_spirals_in_motion.jpg?w=300" medium="image">
			<media:title type="html">danwashere flash spirals in motion</media:title>
		</media:content>
	</item>
	</channel>
</rss>
