dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Changing the cursor?

  1. #1
    Junior Member
    Join Date
    May 2005
    Posts
    13

    Changing the cursor?

    Hello,
    Can anyone tell me how to keep the mouse pointer as an arrow when this is moved over a button instead of changing to a hand icon. I know you can somehow swap the arrow for other icons.
    Any ideas out there?

    Many thanks.

    Andrew
    http://www.andrew-stewart.co.uk

  2. #2
    Senior Member olias32's Avatar
    Join Date
    Jan 2003
    Location
    Romania
    Posts
    126

    hi kitekid

    there are 2 solutions to your problem

    the simpler is this: hide the mouse cursor using the Mouse.hide() command and then draw a MC and add the following action to it:

    Code:
    onClipEvent(enterFrame) {
    	this._x = _root._xmouse;
    	this._y = _root._ymouse;
    }
    i've attached a fla so you can understand better. make sure to have a frame rate of at least 24-25 (i use 30) in order to have a smooth cursor movement.


    another solution is to not use buttons at all, but rather MC's with a bit more complicated code attached. I suggest the first. However tell me if you are not satisfied and i'll post a fla with the second solution.

    Hope it helps.
    Cheers
    Attached Files Attached Files

  3. #3
    Senior Member
    Join Date
    Nov 2001
    Posts
    1,145
    i cant get search to work, search for "truly smooth movement" i think to find post on how to make smooth movement in flash - frame controlled movement is always jerky

    gotta use mouseMove instead of enterFrame, and make sure to use updateAfterEvent(); - code used in thread i cant find

  4. #4
    Junior Member
    Join Date
    May 2005
    Posts
    13

    Thanks guys.

    Thanks Olias,
    The first one works well, but as you said the movement might be a bit jerky. There's alot going on in my movie and increasing the frame rate makes it worse! Would be interested to see how MC code would work instead of buttons.
    Thanks moot, Im still learning how to put bits of code together other than the basic nav stuff, so not really sure about your ideas on this, but it makes sense. My movie really needs to be smoother. Have not found your mentioned code to acheive the same effect.
    Andrew.
    http://www.andrew-stewart.co.uk

  5. #5
    Senior Member
    Join Date
    Nov 2001
    Posts
    1,145
    found the thread but yeah it's kinda complicated

    http://www.flashkit.com/board/showthread.php?t=603340

    ill throw together a smooth cursor replacer and post file here tonight or tomorrow am

  6. #6
    Junior Member
    Join Date
    Mar 2001
    Location
    London
    Posts
    25
    I was looking for a Mouse Hide script and this works great. Cheers olias32

  7. #7
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    I thought the question was how to disable the hand cursor rather than how to change or hide the cursor?

    the way to stop a button from changing the mouse icon into a hand is to set it's useHandCursor property to false.


    e.g.
    Code:
    my_button.useHandCursor = false;
    Last edited by Lexicon; 07-01-2005 at 11:11 AM.
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  8. #8
    Junior Member
    Join Date
    May 2005
    Posts
    13

    Thanks mate.

    This is the one!!
    Thanks Lexicon. Was interesting to see all the other stuff though! Dont have to worry about the smoothness of the movie now!

    Quote Originally Posted by Lexicon
    I thought the question was how to disable the hand cursor rather than how to change or hide the cursor?

    the way to stop a button from changing the mouse icon into a hand is to set it's useHandCursor property to false.


    e.g.
    Code:
    my_button.useHandCursor = false;
    http://www.andrew-stewart.co.uk

  9. #9
    Senior Member
    Join Date
    Nov 2001
    Posts
    1,145
    gotta do your own cursor on some things, not normal stull like text and buttons but stuff with more interaction

    used this to make my own mock pointer and hand because i had a draggable object with buttons on it. normally pointer would always be a pointer hand over everything so i changed it to a normal arrow over the draggable area that changes to closed hand on click/drag and a pointer hand when over buttons

    anyways, check out this flash to see how smooth flash can get
    Attached Files Attached Files
    Last edited by moot; 07-01-2005 at 12:15 PM.

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