开发者

Animate busy cursor in flex?

开发者 https://www.devze.com 2022-12-25 21:08 出处:网络
I find out how to replace the busy cursor h开发者_JAVA百科ere: http://livedocs.adobe.com/flex/3/html/cursormgr_3.html

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

精彩评论

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