This content has been marked as final. Show 9 replies
You can set the cursor that is used when the mouse is over a sprite like
That is the finger pointer. Check out the help file for a list of all
of them. Anyway, set it to zero when you want it to have the standard
default one, and 280 when you want it to be the pointer (or other
numbers for other cursors as you like)
> You can set the cursor that is used when the mouse is over a sprite like
> That is the finger pointer. Check out the help file for a list of all of
> them. Anyway, set it to zero when you want it to have the standard
> default one, and 280 when you want it to be the pointer (or other numbers
> for other cursors as you like)
If you want to use your own graphics for a cursor, use cursor=200 in the
startMovie or something, then create a sprite of your graphic (don't forget
to move the regpoint in the Paint window to where you want your hot-point)
and either use the Sprite Track Mouse behavior from the library
(unneccesarily bulky) or script your own by using:
on exitFrame me
sprite(me.spriteNum).loc = the mouseLoc
Then you can change between different cursor graphics simply by changing the
member of that sprite.
addendum to the addendum:
you will have better luck using prepareFrame instead of exitFrame for
the custom cursor. If you have a complex scene, the cursor will "drag"
behind the actual mouse location if it is in exitFrame. It will be
placed better if you use prepareFrame.
> you will have better luck using prepareFrame instead of exitFrame for the
> custom cursor. If you have a complex scene, the cursor will "drag" behind
> the actual mouse location if it is in exitFrame. It will be placed better
> if you use prepareFrame.
Right, my bad. I was thinking that or enterFrame maybe. PrepareFrame
doesn't always work, I've found. Like, you can use it on a frame script,
but it doesn't necessarily do what you'd expect on a behavior. As always,
use trial and error to find the best way...
Mike, I want to avoid putting a sprite on the stage (as I have 250 separate movies requiring the same bit of coding at the same position)
I want the curser to change ( to Finger 280) when the user passes the cursor over a certain area of my background and revert to normal when moved outside of these co-ordinates
You could make a script that you add to startMovie or something that
creates a scripted sprite that has a blend of 0, the rect that defines
the area you are referring to, and that cursor changing code.
Or you could have a movie script that constantly checks the placement of
the cursor and changes it if needed. That would add some overhead to the
program and may sow things down if you program is complex.
Mike - I can get it to change to a finger when passing the cursor over the right place...
if the mousev < 530 and the mousev> 510 then
if the mouseh>216 and the mouseh<272 then
sprite(1).cursor = 280 -- Sprite (1) is the background
I now just need a similar bit to say if the cursor is anywhere else OR when it leaves those co-ordinates to revert to default
Fixed it. !!!
Set the sprite(1).cursor = 0
then add the co-ordinates bit and it all works !!
thanks for your help
If you say:
at the top of the script, then it will basically tell it to always be 0
(default) unless the outcome of your if...then statement tells it to use
Or you could put a few ...else... statements in there.