In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

ネイティブマウスカーソルのテスト

ネイティブマウスカーソルならFlash外にはみ出して表示出来たりしてオシャレ

ところで+カーソルに変えてるサイトって黒歴史なサイトが多いよね
Get Adobe Flash player
by undo 06 Jul 2011
  • Related works: 2
  • Talk

    undo at 06 Jul 2011 11:24
    Flash10.2以上 Mac - Firefox4はダメだった SafariならOK
    Embed
package
{
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.display.MovieClip;
    import flash.display.Sprite;
    import flash.events.MouseEvent;
    import flash.geom.Point;
    import flash.ui.Mouse;
    import flash.ui.MouseCursor;
    import flash.ui.MouseCursorData;
    
    
    [SWF(width="465",height="465",frameRate="30",backgroundColor="0xffffff")]
    public class ASTest extends Sprite
    {
        public function ASTest()
        {
            init();
        }
        
        private function init():void
        {
            var cursor:Sprite = new Sprite();
            cursor.graphics.lineStyle(1,0);
            cursor.graphics.moveTo(16,0);
            cursor.graphics.lineTo(16,32);
            cursor.graphics.moveTo(0,16);
            cursor.graphics.lineTo(32,16);
            
            var vector:Vector.<BitmapData> = new Vector.<BitmapData>();
            vector[0] = new BitmapData(32,32,true,0x00000000);
            vector[0].draw(cursor);
            
            var cursorData:MouseCursorData = new MouseCursorData();
            cursorData.hotSpot = new Point(16,16);
            cursorData.data = vector;
            Mouse.registerCursor('myCursor', cursorData);
            
            Mouse.cursor = 'myCursor';
            
            //stage.addEventListener(MouseEvent.CLICK, onClick);
        }
        
        private function onClick(evt:MouseEvent):void
        {
            //システムデフォルトに戻す場合
            Mouse.cursor = MouseCursor.AUTO;
        }
    }
}