<?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 Tutorial &#187; Flex User Interface</title>
	<atom:link href="http://flextutorial.org/category/flex-user-interface/feed/" rel="self" type="application/rss+xml" />
	<link>http://flextutorial.org</link>
	<description>Rich Internet Application Development by Adobe Flex</description>
	<lastBuildDate>Fri, 11 Dec 2009 05:54:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Provide a Better Visual Feedback &#8211; Using Flex CursorManager</title>
		<link>http://flextutorial.org/2009/06/24/provide-a-better-visual-feedback-using-flex-cursormanager/</link>
		<comments>http://flextutorial.org/2009/06/24/provide-a-better-visual-feedback-using-flex-cursormanager/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 18:59:07 +0000</pubDate>
		<dc:creator>Bryan</dc:creator>
				<category><![CDATA[Flex User Interface]]></category>
		<category><![CDATA[BusyCursory]]></category>
		<category><![CDATA[Control Cursor in Flex]]></category>
		<category><![CDATA[Cursor]]></category>
		<category><![CDATA[Cursor Class]]></category>
		<category><![CDATA[CursorManager]]></category>
		<category><![CDATA[Flex WebService]]></category>
		<category><![CDATA[User Experience]]></category>
		<category><![CDATA[Visual Feeback]]></category>
		<category><![CDATA[Web Service]]></category>

		<guid isPermaLink="false">http://flextutorial.org/?p=691</guid>
		<description><![CDATA[Why do you need Flex CursorManager Flex is all about User Experience. A Rich Internet Application (RIA) is not just attractive skins or fancy animations. It also means interacting with users and helping them use your application better. One important part of User Experience is to provide a better visual feedback. For example, when someone [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff6600;"><strong>Why do you need Flex CursorManager<br />
</strong></span></p>
<p>Flex is all about <strong>User Experience</strong>. A Rich Internet Application (<strong>RIA</strong>) is not just attractive skins or fancy animations. It also means interacting with users and helping them use your application better.</p>
<p>One important part of User Experience is to <strong>provide a better visual feedback</strong>. For example, when someone types a model name and clicks Search button, it might take 2-3 seconds to get results from a web service.  <strong>What would a user do during that time?</strong> He or she probably keeps clicking the Search button, or thinks your application is dead.</p>
<p>So how to let users know what is going on with your application? You need to give them some visual feedback: like show the busy cursor when waiting for the back end response, and then remove the busy cursor when the data is ready.</p>
<p>To control the cursor image in Flex, you need <strong>CursorManager</strong>.</p>
<p><span id="more-691"></span></p>
<p><span style="color: #ff6600;"><strong>How to use CursorManager</strong></span></p>
<p>Here is how you typically use <strong>CursorManager </strong>in <strong>Flex</strong>:</p>
<blockquote>
<pre><strong><span style="color: #0000ff;"><span style="color: #000000;">- Display the default busy cursor</span>
  </span></strong><span style="color: #0000ff;">CursorManager.setBusyCursor();</span>

<span style="color: #000000;"><strong>- Remove the busy cursor</strong></span>
  <span style="color: #0000ff;">CursorManager.removeBusyCursor();</span>

<span style="color: #000000;"><strong>- Create a new Cursor from your own cursor class</strong></span>
<strong><span style="color: #0000ff;">  </span></strong><span style="color: #0000ff;">[Bindable]
  [Embed(source="assets/heart.gif")]
  private var HeartCursor:Class;
</span><span style="color: #0000ff;">  var cursorID:int = CursorManager.setCursor(HeartCursor);</span>

<span style="color: #0000ff;"><strong><span style="color: #000000;">- Removes a cursor from the cursor list</span>
  </strong>CursorManager.removeCursor(cursorID);
</span>
<strong><span style="color: #000000;">- Remove all cursors</span>
  </strong><span style="color: #0000ff;">CursorManager.removeAllCursors();</span></pre>
</blockquote>
<p><span style="color: #ff6600;"><strong>Sample Code</strong></span></p>
<blockquote>
<pre><span style="color: #0000ff;">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"&gt;

    <span style="color: #008000;">&lt;mx:Script&gt;</span>
      &lt;![CDATA[
         import mx.managers.CursorManager;

         private var cursorId:int;

         [Bindable]
         [Embed(source="assets/heart.gif")]
         private var HeartCursor:Class;

         private <span style="color: #008000;">function </span>showBusyCursor():void {
           CursorManager.setBusyCursor();
         }

         private <span style="color: #008000;">function </span>removeBusyCursor():void {
           CursorManager.removeBusyCursor();
         }            

         private <span style="color: #008000;">function </span>showHeartCursor():void {
           cursorId = CursorManager.setCursor(HeartCursor);
         }

         private <span style="color: #008000;">function </span>removeHeartCursor():void {
           CursorManager.removeCursor(cursorId);
         }
     ]]&gt;
    <span style="color: #008000;">&lt;/mx:Script&gt;</span>

    &lt;mx:Panel title="Flex Tutorial - Cursor Manager"
        width="500" height="200"
        horizontalCenter="0" verticalCenter="0" verticalGap="20"
        horizontalAlign="center" verticalAlign="middle"&gt;

        &lt;mx:HBox&gt;
          &lt;mx:Button label="Show Busy Cursor"
                     click="showBusyCursor()"/&gt;
          &lt;mx:Button label="Remove Busy Cursor"
                     click="removeBusyCursor()"/&gt;
        &lt;/mx:HBox&gt;

        &lt;mx:HRule width="95%"/&gt;

        &lt;mx:HBox&gt;
          &lt;mx:Button label="Show Heart Cursor"
                     click="showHeartCursor()"/&gt;
          &lt;mx:Button label="Remove Heart Cursor"
                     click="removeHeartCursor()"/&gt;
        &lt;/mx:HBox&gt;
   &lt;/mx:Panel&gt;

&lt;/mx:Application&gt;</span></pre>
</blockquote>
<p><span style="color: #ff6600;"><strong>Conclusion</strong></span></p>
<p><strong>CursorManager </strong>offers a convienent way for you to control cursor display in Flex. By using it properly, you will provide a better visual feedback to users, thus enhance the user experience of your applicaton.</p>
]]></content:encoded>
			<wfw:commentRss>http://flextutorial.org/2009/06/24/provide-a-better-visual-feedback-using-flex-cursormanager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

