cursorutils.as

来自「用Flex实现的一个关于减肥系统的web界面,内部没有实际的业务逻辑,只是一个原」· AS 代码 · 共 32 行

AS
32
字号
package sjd.utils
{
	import mx.managers.CursorManager;
	import mx.managers.CursorManagerPriority;
	
	/**
	 * @class CursorUtil
	 * @brief Set the cursor image
	 * @author Jove
	 * @version 1.0
	 */
	public class CursorUtils{

		private static var currentType:Class = null;
				
		/**
		 * Remove the current cursor and set an image.
		 * @param type The image class
		 * @param xOffset The xOffset of the cursorimage
		 * @param yOffset The yOffset of the cursor image
		 */
		public static function changeCursor(type:Class, xOffset:Number = 0, yOffset:Number = 0):void{
			if(currentType != type){
				currentType = type;
				CursorManager.removeCursor(CursorManager.currentCursorID);
				if(type != null){
					CursorManager.setCursor(type, CursorManagerPriority.MEDIUM, xOffset, yOffset);
				}
			}
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?