This content has been marked as final. Show 5 replies
use puppetsound for the sound
Put the mouseUp on the items as well.
put a transparent shape cast member with a blend of 0 over the protected
areas and put a mouseUp handler on them that has nothing in it. The mouse
click will be captured.
Of course there are many, many ways to accomplilsh what you want.
Word of Mouth Productions
"m@rkit" <firstname.lastname@example.org> wrote in message
> Right the basic story is that im making this game where animals cross the
> screen and you shoot them (aka click the mouse on them) and get points. Im
> having a couple of problems.
> I wanted to have the gunshot noise whenever i clicked ANYWHERE so i put it
> the mousup in a frame script but when i click on the sprite it doesnt play
> Secondly, there are items on the stage such as waves and grass that the
> animals can hide behind and i can still click on them even if i cant see
> ie click the part of the grass they are hiding behind. How do i correct
> Any help would be appreaciated. Thank you!!!
You don't normally attach user event code to a frame. User events, like
mouse clicks, are normally associated with an individual item, like a
sprite. Shooter games get around this limitation by using key events for
the shooting action. Since key events are read by the computer and then
sent to the Director movie, they can be read by a keyDown or keyUp
There is a corollary for the mouse, the mouseDown and the mouseUp
script. Since any system wide property like a keyDownScript or a
mouseDownScript will take all key or mouse events, they need to be used
with care and caution. While this is not usually a big problem with key
events, mouse events are likely to cause some difficulty. While the
mouseDownScript will always execute first, it will most likely pass the
event on to any active sprite. This may or may not be what you want to
have happen, you may want an either/or situation not an and situation.
A simple way to block a sprite's behavior when it is hidden is to place
a stopEvent command on the sprite that sits on top.
Adobe Community Expert
If a behavior handles the mouseUp event, the mouseUp event will not be automatically forwarded to the Movie Script. You need to explicitly "pass" the event up the hierarchy:
-- do sprite stuff
put "This line will not be executed: pass acts like 'exit' or 'return'"
thank you so much, now that u mention that, i do remember doing about it but not quite understanding what it did. Thank you to everyone else to for their suggestions and solutions!!!!