I am working on a new project
I am trying to get a certain tune activated (castmember) when the curser moves
over a certain area on the stage ,without using sprites .
I would be verry happy if someone could help with some basic scripting.
Paul
Try using the inside function. For example:
if the mouseLoc.inside(rect(20,20,60,60)) then
alert "inside"
end if
But this will result in a problem. If you go to another frame, this effect will still linger on.
So currently I specify another condition to make sure that the effect is removed when it goes to another frame.
But is there any other way?
Any comments are welcome. Thanks.
Ok.
First, you need to determine the area for detecting the mouse. Drag a dummy sprite onto the stage and adjust the position and size to fit the area. Take note of the sprite's rect(the 4 numbers). That will be the area.
After that, you can delete away the sprite.
Now, go to a frame script and write this:
-----------------------------------------
property pArea
on beginSprite me
pArea = rect(the 4 numbers)
end
on exitframe me
go to the frame
if the mouseLoc.inside(pArea) then
alert "inside"
end if
end
-----------------------------------------
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.