改变鼠标状态状态

http://blog.minidx.com/2008/09/06/1364.html

Flex中通过CursorManager的静态函数setBusyCursor和removeBusyCursor设置鼠标为Busy状态并通过调用setCursor和removeCursor来设置自己的图标的例子

By Minidxer | September 6, 2008

接下来的例子演示了Flex中如何通过CursorManager的静态函数setBusyCursor和removeBusyCursor,设置鼠标为Busy状态,并通过调用setCursor和removeCursor来设置自己的图标。

让我们先来看一下Demo 可以右键View Source或点击这里 察看源代码):

<script type="text/javascript"><!-- google_ad_client = "pub-2748932162110627"; /* 1st-Minidx-Article-336-280-01 */ google_ad_slot = "5298684134"; google_ad_width = 336; google_ad_height = 280; //--> </script>
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"> </script> <script src="http://googleads.g.doubleclick.net/pagead/test_domain.js"></script> <script>window.google_render_ad();</script>

 

 

下面是完整代码(或点击这里 察看):

Download: main.mxml
  1. <? xml version = " 1.0 " encoding = " utf-8 " ?>
  2. < mx:Application   xmlns:mx = " http://www.adobe.com/2006/mxml "
  3.         layout = " vertical "
  4.         verticalAlign = " middle "
  5.         backgroundColor = " white " >
  6.  
  7.     < mx:Script >
  8.         <![CDATA[
  9.             import mx.managers.CursorManager;
  10.  
  11.             [Bindable]
  12.             [Embed(source="assets/bug.png")]
  13.             private var BugIcon:Class;
  14.  
  15.             [Bindable]
  16.             [Embed(source="assets/bug_delete.png")]
  17.             private var BugDeleteIcon:Class;
  18.  
  19.             private var cursorID:int;
  20.         ]]>
  21.     </ mx:Script >
  22.  
  23.     < mx:ApplicationControlBar   dock = " true " >
  24.         < mx:Button   label = " setBusyCursor() "
  25.                 click = " CursorManager.setBusyCursor(); "   />
  26.         < mx:Button   label = " removeBusyCursor() "
  27.                 click = " CursorManager.removeBusyCursor(); "   />
  28.     </ mx:ApplicationControlBar >
  29.  
  30.     < mx:Button   label = " setCursor() "
  31.             width = " 100 "
  32.             height = " 100 "
  33.             rollOver = " cursorID = CursorManager.setCursor(BugIcon); "
  34.             rollOut = " CursorManager.removeCursor(cursorID); "   />
  35.  
  36. </ mx:Application >

你可能感兴趣的:(JavaScript,.net,Flex,Google,Adobe)