<?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>Flex Examples &#187; CursorManager</title>
	<atom:link href="http://blog.flexexamples.com/category/cursormanager/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Changing the mouse cursor when rolling over items in an MX List control in Flex</title>
		<link>http://blog.flexexamples.com/2010/02/01/changing-the-mouse-cursor-when-rolling-over-items-in-an-mx-list-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2010/02/01/changing-the-mouse-cursor-when-rolling-over-items-in-an-mx-list-control-in-flex/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 01:56:46 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[CursorManager]]></category>
		<category><![CDATA[List]]></category>
		<category><![CDATA[hasOwnProperty()]]></category>
		<category><![CDATA[itemRollOut]]></category>
		<category><![CDATA[itemRollOver]]></category>
		<category><![CDATA[removeAllCursors()]]></category>
		<category><![CDATA[setCursor()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2363</guid>
		<description><![CDATA[<p>The following example shows how you can change the mouse cursor when rolling over an item in an MX List control in Flex by listening for the itemRollOver and itemRollOut events and using the CursorManager.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/02/01/changing-the-mouse-cursor-when-rolling-over-items-in-an-mx-list-control-in-flex/ --&#62; &#60;mx:Application name=&#34;MX_List_itemRollOver_cursor_test&#34; xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;vertical&#34; verticalAlign=&#34;middle&#34; backgroundColor=&#34;white&#34;&#62; &#160; &#60;mx:Script&#62; &#60;![CDATA[ import mx.events.ListEvent; &#160; [Embed(&#34;assets/accept.png&#34;)] [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can change the mouse cursor when rolling over an item in an MX List control in Flex by listening for the <code>itemRollOver</code> and <code>itemRollOut</code> events and using the CursorManager.</p>
<p><span id="more-2363"></span></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/02/01/changing-the-mouse-cursor-when-rolling-over-items-in-an-mx-list-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;MX_List_itemRollOver_cursor_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            import mx.events.ListEvent;</span>
&nbsp;
<span style="color: #339933;">            [Embed(&quot;assets/accept.png&quot;)]</span>
<span style="color: #339933;">            public static const accept:Class;</span>
&nbsp;
<span style="color: #339933;">            [Embed(&quot;assets/anchor.png&quot;)]</span>
<span style="color: #339933;">            public static const anchor:Class;</span>
&nbsp;
<span style="color: #339933;">            protected function list_itemRollOverHandler(evt:ListEvent):void {</span>
<span style="color: #339933;">                var dat:Object = evt.itemRenderer.data;</span>
<span style="color: #339933;">                if (dat.hasOwnProperty(&quot;curses&quot;)) {</span>
<span style="color: #339933;">                    cursorManager.setCursor(dat.curses);</span>
<span style="color: #339933;">                }</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            protected function list_itemRollOutHandler(evt:ListEvent):void {</span>
<span style="color: #339933;">                cursorManager.removeAllCursors();</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:List</span> id=<span style="color: #ff0000;">&quot;list&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;200&quot;</span></span>
<span style="color: #000000;">            itemRollOver=<span style="color: #ff0000;">&quot;list_itemRollOverHandler(event);&quot;</span></span>
<span style="color: #000000;">            itemRollOut=<span style="color: #ff0000;">&quot;list_itemRollOutHandler(event);&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ArrayCollection</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;Anchor cursor&quot;</span> curses=<span style="color: #ff0000;">&quot;{anchor}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;default cursor&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;Anchor cursor&quot;</span> curses=<span style="color: #ff0000;">&quot;{anchor}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;Accept cursor&quot;</span> curses=<span style="color: #ff0000;">&quot;{accept}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ArrayCollection</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:List</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Or, if you didn&#8217;t want to use data binding in the data provider, you could set a simple string to an embedded image, as seen in the following example:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/02/01/changing-the-mouse-cursor-when-rolling-over-items-in-an-mx-list-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;MX_List_itemRollOver_cursor_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            import flash.utils.getDefinitionByName;</span>
<span style="color: #339933;">            import mx.events.ListEvent;</span>
&nbsp;
<span style="color: #339933;">            [Embed(&quot;assets/accept.png&quot;)]</span>
<span style="color: #339933;">            public const accept:Class;</span>
&nbsp;
<span style="color: #339933;">            [Embed(&quot;assets/anchor.png&quot;)]</span>
<span style="color: #339933;">            public const anchor:Class;</span>
&nbsp;
<span style="color: #339933;">            protected function list_itemRollOverHandler(evt:ListEvent):void {</span>
<span style="color: #339933;">                var dat:Object = evt.itemRenderer.data;</span>
<span style="color: #339933;">                if (dat.hasOwnProperty(&quot;curses&quot;)) {</span>
<span style="color: #339933;">                    var cursorClass:Class = this[dat.curses] as Class;</span>
<span style="color: #339933;">                    cursorManager.setCursor(cursorClass);</span>
<span style="color: #339933;">                }</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            protected function list_itemRollOutHandler(evt:ListEvent):void{</span>
<span style="color: #339933;">                cursorManager.removeAllCursors();</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:List</span> id=<span style="color: #ff0000;">&quot;list&quot;</span></span>
<span style="color: #000000;">            itemRollOver=<span style="color: #ff0000;">&quot;list_itemRollOverHandler(event);&quot;</span></span>
<span style="color: #000000;">            itemRollOut=<span style="color: #ff0000;">&quot;list_itemRollOutHandler(event);&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ArrayCollection</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;Anchor cursor&quot;</span> curses=<span style="color: #ff0000;">&quot;anchor&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;default cursor&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;Anchor cursor&quot;</span> curses=<span style="color: #ff0000;">&quot;anchor&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;Accept cursor&quot;</span> curses=<span style="color: #ff0000;">&quot;accept&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ArrayCollection</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:List</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the mouse cursor when rolling over items in an MX List control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/02/01/changing-the-mouse-cursor-when-rolling-over-items-in-an-mx-list-control-in-flex/',contentID: 'post-2363',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'hasOwnProperty(),itemRollOut,itemRollOver,removeAllCursors(),setCursor()',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2010/02/01/changing-the-mouse-cursor-when-rolling-over-items-in-an-mx-list-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing the cursor in a Flex application using the CursorManager class</title>
		<link>http://blog.flexexamples.com/2007/09/10/changing-the-cursor-in-a-flex-application-using-the-cursormanager-class/</link>
		<comments>http://blog.flexexamples.com/2007/09/10/changing-the-cursor-in-a-flex-application-using-the-cursormanager-class/#comments</comments>
		<pubDate>Tue, 11 Sep 2007 06:54:10 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[CursorManager]]></category>
		<category><![CDATA[removeBusyCursor()]]></category>
		<category><![CDATA[removeCursor()]]></category>
		<category><![CDATA[setBusyCursor()]]></category>
		<category><![CDATA[setCursor()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/10/changing-the-cursor-in-a-flex-application-using-the-cursormanager-class/</guid>
		<description><![CDATA[<p>The following code shows how you can toggle the &#8220;busy&#8221; cursor in Flex using the static setBusyCursor() and removeBusyCursor() methods in the CursorManager class, as well as using your own custom cursors by calling the static setCursor() and removeCursor() methods.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/CursorManager_setBusyCursor_test/main.mxml">View MXML</a></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2007/09/10/changing-the-cursor-in-a-flex-application-using-the-cursormanager-class/ [...]]]></description>
			<content:encoded><![CDATA[<p>The following code shows how you can toggle the &#8220;busy&#8221; cursor in Flex using the static <code>setBusyCursor()</code> and <code>removeBusyCursor()</code> methods in the CursorManager class, as well as using your own custom cursors by calling the static <code>setCursor()</code> and <code>removeCursor()</code> methods.</p>
<p>Full code after the jump.</p>
<p><span id="more-169"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/CursorManager_setBusyCursor_test/main.mxml">View MXML</a></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2007/09/10/changing-the-cursor-in-a-flex-application-using-the-cursormanager-class/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            import mx.managers.CursorManager;</span>
&nbsp;
<span style="color: #339933;">            [Bindable]</span>
<span style="color: #339933;">            [Embed(source=&quot;assets/bug.png&quot;)]</span>
<span style="color: #339933;">            private var BugIcon:Class;</span>
&nbsp;
<span style="color: #339933;">            [Bindable]</span>
<span style="color: #339933;">            [Embed(source=&quot;assets/bug_delete.png&quot;)]</span>
<span style="color: #339933;">            private var BugDeleteIcon:Class;</span>
&nbsp;
<span style="color: #339933;">            private var cursorID:int;</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> dock=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;setBusyCursor()&quot;</span></span>
<span style="color: #000000;">                click=<span style="color: #ff0000;">&quot;CursorManager.setBusyCursor();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;removeBusyCursor()&quot;</span></span>
<span style="color: #000000;">                click=<span style="color: #ff0000;">&quot;CursorManager.removeBusyCursor();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;setCursor()&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;100&quot;</span></span>
<span style="color: #000000;">            height=<span style="color: #ff0000;">&quot;100&quot;</span></span>
<span style="color: #000000;">            rollOver=<span style="color: #ff0000;">&quot;cursorID = CursorManager.setCursor(BugIcon);&quot;</span></span>
<span style="color: #000000;">            rollOut=<span style="color: #ff0000;">&quot;CursorManager.removeCursor(cursorID);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/CursorManager_setBusyCursor_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/CursorManager_setBusyCursor_test/bin/main.html" width="100%" height="250"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the cursor in a Flex application using the CursorManager class on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/09/10/changing-the-cursor-in-a-flex-application-using-the-cursormanager-class/',contentID: 'post-169',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'removeBusyCursor(),removeCursor(),setBusyCursor(),setCursor()',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/09/10/changing-the-cursor-in-a-flex-application-using-the-cursormanager-class/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

