title: Converting a JPG to a Class at runtime
body: <p>Some methods in the Flex API such as <a href="http://livedocs.adobe.com/flex/3/langref/mx/managers/CursorManager.html#setCursor()" rel="nofollow noreferrer">CursorManager.setCursor(cursorClass:Class, priority:int = 2, xOffset:Number = 0, yOffset:Number = 0)</a> take a parameter of type Class for a graphic. This example lets you specify a JPG/BMP/SWF as the cursor, but the only way I know to get a Class from an image file is using [Embed] in MXML, and this needs to be done dynamically in AS3 in my case.</p>
  
  <p>There must be a standard solution? Is there a good reason these Flex classes take a Class in the first place?</p>
  
  <p>EDIT: I don't actually care about emulating the [Embed] tag's behaviour. I just want to be able to use an image file path with CursorManager. I'm sure I've seen this done in other situations, and surely the Flex people figured these things would not always be hard-coded?</p>
  
  <p>EDIT2: To further simplify the problem, what I'm ideally looking for is a way to do the following:<code>CursorManager.setCursor(someHandyFunction("myCursor.png"))</code>
  If this is even possible, the question is what <code>someHandyFunction</code> should do?!</p>