开发者

Animate busy cursor in flex?

I find out how to replace the busy cursor h开发者_JAVA百科ere: http://livedocs.adobe.com/flex/3/html/cursormgr_3.html

However, how do you animate an image for the cursor?


Use an animated asset created in the Flash IDE and embed it within your Flex app.


You can also create them programmatically, e.g. by extending flash.display.Sprite:

Class SampleCursor:

public class SampleCursor extends Sprite
    public function SampleCursor() {
        addEventListener(Event.ENTER_FRAME, drawCursor);
    }

    public function drawCursor(e:Event):void {
        // Draw cursor using graphics context
        // ...
    }
{

And in your Application you just register this class as a cursor (same for other types of cursors like bitmap or flash assets):

cursorManager.removeAllCursors();
cursorManager.setCursor(SampleCursor);

Hope that helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜