A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Changing the mouse cursor? (not custom)

  1. #1
    I'm not afraid Fearless's Avatar
    Join Date
    Jun 2000
    Posts
    351

    Changing the mouse cursor? (not custom)

    I have a couple loaders that pull in bitmaps, once they're loaded and up I have an onmouseClick listener that triggers a navigateToURL. I haven't put them into simpleButtons because it has worked fine, but the mouse cursor stays an arrow. Is there any way I can just change the cursor to a pointer? or do I need to make them buttons?

  2. #2
    Senior Member ozmic66's Avatar
    Join Date
    Oct 2005
    Posts
    472
    you can try this:

    Code:
    mc.buttonMode = true;
    mc.useHandCursor = true;
    Pixelwave Flash-based iPhone framework
    iPhone Games: Flyloop | Freedom Run

    Twitter: Oztune

  3. #3
    I'm not afraid Fearless's Avatar
    Join Date
    Jun 2000
    Posts
    351
    Code:
    ReferenceError: Error #1056: Cannot create property buttonMode on flash.display.Loader.
    	at photoad/::onmouseover()

  4. #4
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    buttonMode is property of Sprite class. You cant use it on bitmaps, must be Sprite or Movie Clip.

  5. #5
    Flash by name, Flash by nature
    Join Date
    May 2006
    Location
    Oslo, Norway
    Posts
    70
    What you could do is adding a mask sprite to each of the loaders and use the buttonMode and useHandCursor properties on that. Something like this:

    PHP Code:
    stop();
    var 
    myLoader:Loader = new Loader();
    myLoader.load(new URLRequest("myBitmap.png"));
    addChild(myLoader);
    var 
    myMask:Sprite = new Sprite();
    myMask.graphics.beginFill(0xFFFFFF0);
    myMask.graphics.drawRect(0,0,400,300);
    myMask.graphics.endFill();
    myMask.buttonMode true;
    myMask.useHandCursor true;
    addChild(myMask);
    myLoader.mask myMask

  6. #6
    Member
    Join Date
    May 2007
    Location
    Poland
    Posts
    65
    or you can put the loader inside the Sprite
    Code:
    myMask.addChild(myLoader)
    this way you don't need to draw additional graphics, the bitmap itself will define the button area.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center