﻿<?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/"
	>

<channel>
	<title>Keith Hair &#187; Adobe AIR</title>
	<atom:link href="http://keith-hair.net/blog/category/adobe-air/feed/" rel="self" type="application/rss+xml" />
	<link>http://keith-hair.net/blog</link>
	<description>Scripting is fun like any other hobby</description>
	<lastBuildDate>Sat, 28 Jan 2012 05:04:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Get an Incremented Filename String</title>
		<link>http://keith-hair.net/blog/2012/01/28/get-an-incremented-filename-string/</link>
		<comments>http://keith-hair.net/blog/2012/01/28/get-an-incremented-filename-string/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 04:59:02 +0000</pubDate>
		<dc:creator>Keith H</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[concatenate]]></category>
		<category><![CDATA[File]]></category>
		<category><![CDATA[filepath]]></category>
		<category><![CDATA[increment]]></category>
		<category><![CDATA[next file]]></category>
		<category><![CDATA[String]]></category>

		<guid isPermaLink="false">http://keith-hair.net/blog/?p=464</guid>
		<description><![CDATA[Some software have the ability to detect the presence of files named in a sequential order. I want to add similar functionality to some experimental scripts I'm working on. For my purposes I'm only focusing on sequential files with numeric prefixes or suffixes in the filenames. The function I've written returns a new filepath thats [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://keith-hair.net/blog/wp-content/uploads/2012/01/incremented_file.jpg" rel="lightbox[464]"><img src="http://keith-hair.net/blog/wp-content/uploads/2012/01/incremented_file.jpg" alt="Incremented file image" title="incremented_file" width="175" height="128" class="alignleft size-full wp-image-475" /></a><br />
Some software have the ability to detect the presence of files named in a sequential order.<br />
I want to add similar functionality to some experimental scripts I'm working on.<br />
For my purposes I'm only focusing on sequential files with numeric prefixes or suffixes in the filenames.<br />
The function I've written returns a new filepath thats incremented. Using regular expressions I diced the filepath up into pieces I could change then concatenate into the next potential filepath. This function is for generating a possible next filepath, so testing the existence of the actual file is not my concern.</p>
<p><br></br></p>
<p><strong>Example 1</strong></p>
<pre class="brush: as3; title: ; notranslate">
trace(getIncrementFilePath(&quot;gallery/image01.png&quot;)); //returns gallery/image02.png
</pre>
<p><strong>Example 2</strong><br />
<em>Creating incremented filepaths in a loop.</em></p>
<pre class="brush: as3; title: ; notranslate">
var path:String=&quot;gallery/image01.png&quot;;

var i:int=0;
while (i &lt; 10)
{
	path=getIncrementFilePath(path);
	trace(path);
	i++;
}

/*
trace output
===================
gallery/image02.png
gallery/image03.png
gallery/image04.png
gallery/image05.png
gallery/image06.png
gallery/image07.png
gallery/image08.png
gallery/image09.png
gallery/image10.png
gallery/image11.png
*/
</pre>
<p><span id="more-464"></span></p>
<p><strong>The source </strong></p>
<pre class="brush: as3; title: ; notranslate">
/**
 * Gets a new filepath with incremented digits .
 *
 * @param filepath The filepath to get an incremented filepath from.
 * @param incrementPrefix If true, any digit prefixes will be incremented in the filepath. This is false by default.
 * @param incrementSuffix If true, any digit suffixes will be incremented in the filepath. This is true by default.
 * @return A filepath with the filename's digit suffix or prefix incremented.
 * Returns an empty String if there are no numbers to increment.
 **/
function getIncrementFilePath(filepath:String=&quot;&quot;,incrementPrefix:Boolean=false,incrementSuffix:Boolean=true):String
{
	var s:String=&quot;&quot;;
	var bre:RegExp=/^\d+/mig;
	var ere:RegExp=/\d+$/mig;
	var dpath:String=(filepath.match(/^.+\//mig)[0])||&quot;&quot;;
	var fs:String=filepath.replace(/^.+(\/|\\)/mig,&quot;&quot;);
	var ext:String=fs.replace(/^.+\./mig,&quot;&quot;);
	var fn:String=fs.replace(/\.\w+$/mig,&quot;&quot;);
	var bd:String=(fn.match(bre))[0]||&quot;&quot;;
	var ed:String=(fn.match(ere))[0]||&quot;&quot;;
	var mids:String=fn.replace(bre,&quot;&quot;).replace(ere,&quot;&quot;);
	var md:String=mids.replace(/^[^\d]+|[^\d]+$/mig,&quot;&quot;);
	var dlen:int;
	var tempstr:String=&quot;&quot;;
	var tempn:int;
	var n:int=0;
	if (incrementPrefix)
	{
		if (bd == &quot;&quot;)
		{
			return &quot;&quot;;
		}
		dlen=String((bd.match(/^0+/mig)[0])||&quot;&quot;).length;
		tempn=parseInt(bd)+1;
		while (n &lt; dlen)
		{
			tempstr+=&quot;0&quot;;
			n++;
		}
		if (String(tempstr+tempn).length &gt; bd.length)
		{
			tempstr=tempstr.substr(1,tempstr.length);
		}
		bd=tempstr+tempn;
	}
	if (incrementSuffix)
	{
		if (ed == &quot;&quot;)
		{
			return &quot;&quot;;
		}
		dlen=String((ed.match(/^0+/mig)[0])||&quot;&quot;).length;
		tempn=parseInt(ed)+1;
		while (n &lt; dlen)
		{
			tempstr+=&quot;0&quot;;
			n++;
		}
		if (String(tempstr+tempn).length &gt; ed.length)
		{
			tempstr=tempstr.substr(1,tempstr.length);
		}
		ed=tempstr+tempn;
	}
	if (ext != &quot;&quot;)
	{
		ext=&quot;.&quot;+ext;
	}
	s=dpath+bd+mids+ed+ext;
	return s;
}
</pre>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=&zqz=&zurlz=http://keith-hair.net/blog/2012/01/28/get-an-incremented-filename-string/&ztz=Get an Incremented Filename String'><img src='http://keith-hair.net/blog/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a>]]></content:encoded>
			<wfw:commentRss>http://keith-hair.net/blog/2012/01/28/get-an-incremented-filename-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>KeyManager revisted for Flex and AS3 Projects</title>
		<link>http://keith-hair.net/blog/2011/02/20/keymanager-revisted-for-flex-and-as3-projects/</link>
		<comments>http://keith-hair.net/blog/2011/02/20/keymanager-revisted-for-flex-and-as3-projects/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 19:47:34 +0000</pubDate>
		<dc:creator>Keith H</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Flash 9]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Game Logic]]></category>
		<category><![CDATA[Gatekeeper]]></category>
		<category><![CDATA[Ghostbusters]]></category>
		<category><![CDATA[Gozer]]></category>
		<category><![CDATA[key codes]]></category>
		<category><![CDATA[KeyboardEvent]]></category>
		<category><![CDATA[KeyManager]]></category>
		<category><![CDATA[Keymaster]]></category>
		<category><![CDATA[Keys]]></category>
		<category><![CDATA[Preventing Sticky Keys]]></category>
		<category><![CDATA[State]]></category>
		<category><![CDATA[Zuul]]></category>

		<guid isPermaLink="false">http://keith-hair.net/blog/?p=293</guid>
		<description><![CDATA[Dana Barrett: Are you the Keymaster? Dr. Peter Venkman: Yes. Actually I'm a friend of his, he asked me to meet him here. -Ghostbusters It's been a whole year since I needed to use the KeyManager class and from comments I've been made aware of bugs in my script. I was hoping the scripts would [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" src="/blog/examples/keymanagerexample/rick_moranis_ghostbusters.jpg" alt="Rick Moranis as Louis Tully in Ghostbusters." /></p>
<blockquote>
<p style="text-align: left;"><em>Dana Barrett: Are you the Keymaster?<br />
Dr. Peter Venkman: Yes. Actually I'm a friend of his, he asked me to meet him here.</em><br />
-Ghostbusters</p>
</blockquote>
<p style="text-align: right;">
<p>It's been a whole year since I needed to use the KeyManager class and from comments I've been made aware of bugs in my script.<br />
I was hoping the scripts would be a sufficient start that should issues arrive, others would come up with work-a-rounds. (Thank you to all who noted solutions and problems.)</p>
<p>Lately I was needing to write some keyboard interactivity again and I wanted to add some features to help simplify newer task...also fix a couple of things in the process.<br />
In Flex, a lot of coding deals with listening to events. The KeyManager needed events for the tasks I was working on. Callback functions where ok at first but adding "KEY_DOWN", "KEY_UP" and "KEY_SEQUENCE" events help make the class more useful for monitoring status. Monitoring events give more options for handling  keyboard activity in one handler function versus using a separate function for each keyboard combination. So now I've updated the class to have both.<br />
<span id="more-293"></span><br />
<strong>This is a simple example of using the KeyManager class with the added features and KeyManagerEvent.</strong><br />
The example application displays the key activity as you press assigned keys. The functions executed should give a simple idea of how you could expand and add your own application/game logic.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_KeyManagerExample_1458701885"
			class="flashmovie"
			width="550"
			height="600">
	<param name="movie" value="/blog/examples/keymanagerexample/KeyManagerExample.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/blog/examples/keymanagerexample/KeyManagerExample.swf"
			name="fm_KeyManagerExample_1458701885"
			width="550"
			height="600">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object><br />
<strong><br />
Missing a few keys</strong><br />
Making something process the fastest is great, but sometimes making something easier is more valuable. With the KeyManager I wanted to assign key combinations with simple String dialect instead of writing a long Keyboard constant. Writing "f1" is much easier than "Keyboard.F1". I tried making the size of the class small by NOT including a big list of all Keyboard constants. The "findKey" method was an attempt to dynamically find the key codes instead. Because of that, the first KeyManager I released did not capture some keys like "F1". To fix this, I went halfway by manually checking some Keyboard constants directly and others dynamically. Attempting it this way was for ease of use like using simple Strings like "up" and "down" but also to make key capturing more robust to capture each key that Flash ActionScript does support.</p>
<p>The KeyManager is written for Flex and AS3 only projects.<br />
I decided to share this class since it solves my current task, but I know it is not a solution for everything. Feel free to comment on it's issues or what's needed.<br />
<a href="/blog/examples/keymanagerexample/srcview/index.html">View Source</a></p>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=&zqz=&zurlz=http://keith-hair.net/blog/2011/02/20/keymanager-revisted-for-flex-and-as3-projects/&ztz=KeyManager revisted for Flex and AS3 Projects'><img src='http://keith-hair.net/blog/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a>]]></content:encoded>
			<wfw:commentRss>http://keith-hair.net/blog/2011/02/20/keymanager-revisted-for-flex-and-as3-projects/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>KeyManager Class for Detecting Key Press Combos or Sequences</title>
		<link>http://keith-hair.net/blog/2010/02/15/keymanager-class-for-detecting-key-press-combos-or-sequences/</link>
		<comments>http://keith-hair.net/blog/2010/02/15/keymanager-class-for-detecting-key-press-combos-or-sequences/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 23:30:12 +0000</pubDate>
		<dc:creator>Keith H</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Flash 9]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[ASWD]]></category>
		<category><![CDATA[control]]></category>
		<category><![CDATA[dev mode]]></category>
		<category><![CDATA[easter eggs]]></category>
		<category><![CDATA[key press]]></category>
		<category><![CDATA[Keyboard]]></category>
		<category><![CDATA[KeyboardEvent]]></category>
		<category><![CDATA[videogames]]></category>

		<guid isPermaLink="false">http://keith-hair.net/blog/?p=189</guid>
		<description><![CDATA[When I am writing a flash app or game which uses the keyboard to control a character's movement, there is a situation that becomes annoying while controlling the character. I do not know the proper term for it ("sticky keys"?) but I will describe it... When an app or game is written we "expect" the [...]]]></description>
			<content:encoded><![CDATA[<p>When I am writing a flash app or game which uses the keyboard to control a character's movement, there is a situation that becomes annoying while controlling the character. I do not know the proper term for it ("sticky keys"?) but I will describe it...<img class="alignright" src="/blog/examples/keycontrol/typing.jpg" alt="keyboard" width="264" height="386" /></p>
<p>When an app or game is written we "expect" the user to precisely press the proper key or key combination at a time to execute programmatic actions. However, most of us have ten fingers and we use more than one finger to press more than one button on the keyboard. The expected program reaction from multiple fingered keyboard input might not occur because you have another function executing when you expect just one at a time.<br />
<span id="more-189"></span></p>
<p><strong>Key Combinations</strong><br />
Imagine you are using the keyboard to play a game. The RIGHT arrow key is for moving your character right, the LEFT arrow key is for moving your character LEFT.<br />
Ok, the action in this game is heating up, you are pressing LEFT to avoid the lasers shooting at you. You successfully dodged the lasers, now you press RIGHT to move in and attack...but in the heat of battle, your other finger is still on the LEFT button. What happens now is your character most likely gets stuck, because both movement keys are pressed telling the character to go in opposite directions!</p>
<p>In some cases allowing multiple key presses is how you want the app to react. For example you want the user to press both UP and RIGHT keys to move the characters in a diagonal direction. When to allow this and when not can be different among all of the control buttons. It becomes messy having to write "If" and "switch" statements to make the KeyboardEvent listeners work according to the different controls needed.</p>
<p><strong>Key Sequences</strong><br />
If you love video games cheats or the easter eggs developers sometimes place in apps you'll remember to access them, you will usually enter in a sequence of key presses. If you entered the sequence successfully you would have access to cool game cheats or some special developer mode of an application.</p>
<p><strong>KeyManager</strong><br />
For the above reasons I've written a KeyManager class to add key control that allows individual keys/keycombos the option to cancel out the any previous key/keycombo that are pressed down...and when key/keycombos are released, whatever key/keycombo that are still pressed will be active again. And for detecting key press sequences the KeyManager class will allow also.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_keycontrol_1535876530"
			class="flashmovie"
			width="550"
			height="400">
	<param name="movie" value="http://keith-hair.net/blog/examples/keycontrol/keycontrol.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://keith-hair.net/blog/examples/keycontrol/keycontrol.swf"
			name="fm_keycontrol_1535876530"
			width="550"
			height="400">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>This is a basic example using KeyManager. The "addKey" method is for adding key press combos and the "addKeySequence" is for obviously adding<br />
key press sequences.</p>
<p>In the working flash example, you can click "singular combos" checkbox to false, to see the problem described previously about the character getting stuck when pressing RIGHT and LEFT key at the same time. When you set the checkbox back to true you will notice how each new key press overrides any others that are still down. This results in responsive execution if a user has a habit of holding down other keys while pressing new ones..</p>
<p><em><strong>Also in the working sample above if you enter in the proper key sequence you will be rewarded with an "Easter Egg" to view the source and FLA.</strong></em></p>
<p><strong>Example usage:</strong></p>
<pre class="brush: as3; title: ; notranslate">
import net.keithhair.KeyManager;

var keyManager:KeyManager;
keyManager=new KeyManager(stage);
keyManager.addKey([&quot;right&quot;], goRight,stopRight,&quot;control1&quot;);
keyManager.addKey([&quot;left&quot;], goLeft,stopLeft,&quot;control2&quot;);
keyManager.addKey([&quot;up&quot;], goUp,stopUp,&quot;control3&quot;);
keyManager.addKey([&quot;down&quot;], goDown,stopDown,&quot;control4&quot;);
keyManager.addKey([&quot;shift&quot;,&quot;w&quot;,&quot;t&quot;], toggleWindow);
keyManager.addKeySequence([&quot;up&quot;,&quot;up&quot;,&quot;down&quot;,&quot;down&quot;,&quot;left&quot;,&quot;right&quot;,&quot;left&quot;,&quot;right&quot;],openEasterEgg);
</pre>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=&zqz=&zurlz=http://keith-hair.net/blog/2010/02/15/keymanager-class-for-detecting-key-press-combos-or-sequences/&ztz=KeyManager Class for Detecting Key Press Combos or Sequences'><img src='http://keith-hair.net/blog/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a>]]></content:encoded>
			<wfw:commentRss>http://keith-hair.net/blog/2010/02/15/keymanager-class-for-detecting-key-press-combos-or-sequences/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Letting DisplayObjects Find the Main WindowedApplication in AIR</title>
		<link>http://keith-hair.net/blog/2009/04/30/letting-displayobjects-find-the-main-windowedapplication-in-air/</link>
		<comments>http://keith-hair.net/blog/2009/04/30/letting-displayobjects-find-the-main-windowedapplication-in-air/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 20:48:59 +0000</pubDate>
		<dc:creator>Keith H</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Cursor]]></category>
		<category><![CDATA[WindowedApplication]]></category>

		<guid isPermaLink="false">http://keith-hair.net/blog/?p=29</guid>
		<description><![CDATA[Here is a way to let a DisplayObject find the main WindowedApplication on its own... In my AIR application I have other AIR Windows floating over the main AIR Window. I wanted one of my UIComponents to be draggable like a cursor, but when my mouse dragged the object over the other floating windows I [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a way to let a DisplayObject find the main WindowedApplication on its own...</p>
<p>In my AIR application I have other AIR Windows floating over the main AIR Window.<br />
I wanted one of my UIComponents to be draggable like a cursor, but when my mouse dragged the object<br />
over the other floating windows I wanted my original cursor to show again and hide my dragged UIComponent.</p>
<p>The reason behind this is if I wanted to apply "context sensitive" behaviors depending on what or which window the mouse is in.</p>
<p>To do this, the main WindowedApplication needed some ROLL_OUT and ROLL_OVER events added to it to detect when the mouse rolls in and out.<br />
The "getAIRAppWindow" method below finds the main WindowedApplication so I can add the listeners to it from there.</p>
<p>Here are some snippets explaining what I did:</p>
<p><span id="more-29"></span></p>
<p><strong>The method needed to find main WindowedApplication</strong></p>
<pre class="actionscript">&nbsp;
<span style="color: #808080; font-style: italic;">/*----------------------------------------------------------
Finds the main WindowedApplication of an AIR application
from any UIComponent and returns it.
------------------------------------------------------------*/</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getAIRAppWindow<span style="color: #66cc66;">&#40;</span>p:DisplayObjectContainer<span style="color: #66cc66;">&#41;</span>:WindowedApplication
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> c:*=p;
	<span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span>c.<span style="color: #006600;">parent</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>c is WindowedApplication<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
					<span style="color: #b1b100;">return</span> WindowedApplication<span style="color: #66cc66;">&#40;</span>c<span style="color: #66cc66;">&#41;</span>;
				<span style="color: #66cc66;">&#125;</span>
			c=c.<span style="color: #006600;">parent</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">null</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<p><strong><br />
Adding events to detect mouse in main Windowed Application</strong></p>
<pre class="actionscript">&nbsp;
_windowedApp=getAIRAppWindow<span style="color: #66cc66;">&#40;</span>parent<span style="color: #66cc66;">&#41;</span>;
&nbsp;
_windowedApp.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">ROLL_OUT</span>,__onMouseOutWorkSpace<span style="color: #66cc66;">&#41;</span>;
_windowedApp.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">ROLL_OVER</span>,__onMouseInWorkSpace<span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p><strong><br />
Example of actions to apply on ROLL_OUT and ROLL_OVER</strong></p>
<pre class="actionscript">&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> __onMouseOutWorkSpace<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">/*--------------------------------------------------------
	When your mouse rolls out of the main WindowedApplication
	(and into other nested Windows) you can make your regular
	mouse cursor show again here, while hiding your custom cursor.
	----------------------------------------------------------*/</span>
	yourCustomCursor.<span style="color: #0066CC;">visible</span>=<span style="color: #000000; font-weight: bold;">false</span>;
	<span style="color: #0066CC;">Mouse</span>.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> __onMouseInWorkSpace<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">/*--------------------------------------------------------
	When your mouse rolls back in the main WindowedApplication
	(and out of other nested Windows) you can hide your regular
	mouse cursor, while showing your custom cursor again.
	----------------------------------------------------------*/</span>
	yourCustomCursor.<span style="color: #0066CC;">visible</span>=<span style="color: #000000; font-weight: bold;">true</span>;
	<span style="color: #0066CC;">Mouse</span>.<span style="color: #0066CC;">hide</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=&zqz=&zurlz=http://keith-hair.net/blog/2009/04/30/letting-displayobjects-find-the-main-windowedapplication-in-air/&ztz=Letting DisplayObjects Find the Main WindowedApplication in AIR'><img src='http://keith-hair.net/blog/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a>]]></content:encoded>
			<wfw:commentRss>http://keith-hair.net/blog/2009/04/30/letting-displayobjects-find-the-main-windowedapplication-in-air/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

