This one looked interesting, so I decided to take a whack at it. Here's what I was able to do -- there's probably a more elegant solution, but I've tested this, and it definitely works (here's a working example), so I figured I'd kick it back over to you to tinker with further if you like.
First, you'll need a custom class extending DisplayObject -- I just chose Bitmap, since I knew you were attempting to load and use JPG imagery:
package
{
import flash.display.Bitmap;
import mx.core.Application;
public class MyLoadedImageClass extends Bitmap
{
public function MyLoadedImageClass()
{
// ClassRef is simply the name of my Flex app
super(ClassRef(Application.application).bitmapData);
}
}
}
... and then here's the Application code, which just loads things up and then calls setCursor():
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="init()">
<mx:Script>
<![CDATA[
import mx.managers.CursorManager;
import mx.managers.CursorManagerPriority;
// This public member holds a reference to your loaded bitmapData,
// which MyLoadedImageClass's constructor will use when instantiated
// by the framework during CursorManager.setCursor()
public var bitmapData:BitmapData;
// Here we load the image
private function init():void
{
var urlLoader:URLLoader = new URLLoader();
var urlRequest:URLRequest = new URLRequest("http://roaming.turbonerd.com/m/20090104094515.jpg");
urlLoader.addEventListener(Event.COMPLETE, urlLoader_complete);
urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
urlLoader.load(urlRequest);
}
// Here we translate the bytes into a Bitmap
private function urlLoader_complete(event:Event):void
{
var bytes:ByteArray = URLLoader(event.target).data;
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loader_complete);
loader.loadBytes(bytes);
}
// And finally, we save off the bytes and set the cursor
private function loader_complete(event:Event):void
{
bitmapData = Bitmap(event.target.content).bitmapData;
CursorManager.setCursor(MyLoadedImageClass, CursorManagerPriority.HIGH);
}
]]>
</mx:Script>
</mx:Application>
Hopefully the commenting describes things in enough detail. Hope it helps! (And thanks for the challenge!)