First, prepare your custom cursor. e.g. mine is a ani file (recommend a cool site http://www.cursors-4u.com to download different kinds of cursor). Then convert your cursor file to swf, if the file is not swf and your cursor is animated one. OK, let me introduce the 3 ways below: Maybe you know setBusyCursor and removeBusyCursor methods of CursorManager, but setCursor and removeCursor are more flexible. you can prepare a custom class , representing and embedding a cursor swf, as a parameter of setCursor, just like: it's a easier way. CursorManager has a style called "busyCursor". So what you should do is , changing to your own class at the begginning of application, e.g. in preinitialize event hanler of Application, like: StyleManager.getStyleDeclaration("CursorManager"). setStyle("busyCursor",myBusyCursor); //myBusyCursor is class, embedding cursor swf i think CSS must be the easiest way. CursorManager
{
busyCursor: Embed("../libs/cur.swf");
} Put it in css file or whereever you like. no problem.
{
busyCursor: Embed("../libs/cur.swf");
} Put it in css file or whereever you like. no problem.
本文介绍了如何使用不同的方法为应用程序设置自定义光标。包括通过准备动画文件并将其转换为SWF格式,利用setCursor方法结合自定义类,更改样式管理器中的busyCursor样式以及直接在CSS中指定光标文件等技巧。

被折叠的 条评论
为什么被折叠?



