I’m trying to use a custom .gif as a cursor, but for some reason Flex 3 is showing that mx.managers.CursorManager no longer exists.
The code I was trying to use (from http://www.adobe.com/devnet/flex/quickstart/controlling_the_cursor/src/CursorCustom/index.html):
import mx.controls.Button;
import mx.managers.CursorManager;
import flash.events.*;
// Embed the SWF that will be used as
// the custom cursor.
[Embed(source="assets/hourglass.swf")]
public var HourGlassAnimation:Class;
private const ON_MESSAGE:String = "Custom Cursor ON";
private const OFF_MESSAGE:String = "Custom Cursor OFF";
private function busyCursorButtonHandler(event:MouseEvent):void
{
var toggleButton:Button = event.target as Button;
if ( toggleButton.selected )
{
// The setCursor() method returns a numeric ID for
// the cursor being set. You can store and use this
// ID later in a removeCursor() call, or, you can
// use the static currentCursorID property of the
// CursorManager class to achieve the same result,
// as we have done in this example.
CursorManager.setCursor(HourGlassAnimation);
toggleButton.label = ON_MESSAGE;
}
else
{
CursorManager.removeCursor( CursorManager.currentCursorID );
toggleButton.label = OFF_MESSAGE;
}
}
Any ideas?
I should mention I am trying to do -everything- in .AS files, so the tutorials which talk about embedding actionscript in a .fla to just do things like
“***startDrag (”_root.cursor", true);
Mouse.hide();"
***are not exactly what I’m looking for.