Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

mouse click doesn't trigger, mouse down/up does

Guest
Apr 29, 2008 Apr 29, 2008
I have a sprite that contains a bunch of sprites. Each of those sprites contain a bunch of bitmaps.

My issue is that the MouseEvent.CLICK isn't triggering on the parent sprite. However, MOUSE_DOWN and MOUSE_UP is.

Are there any cases in which this would happen? I'm having a hard time understanding why.

Thanks.
TOPICS
ActionScript
519
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 29, 2008 Apr 29, 2008
unless you're doing something to stop propagation/bubbling, the parent sprite will detect mouseevents detected by any child sprite.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 30, 2008 Apr 30, 2008
Nope, I'm not doing any stopping. I'm wondering if it is because the sprite contains bitmaps, not sprites?

At any rate, the confusing thing to me is why down/up triggers, but not click. According to the docs, it says:

For a click event to occur, it must always follow this series of events in the order of occurrence: mouseDown event, then mouseUp. The target object must be identical for both of these events; otherwise the click event does not occur.

Seems to imply that the target is changing... I'll put in some print outs to see if that is the case.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 30, 2008 Apr 30, 2008
LATEST
Ah, nevermind, figured it out.

The problem was that I was rebuilding my display list each frame (because things are constantly changing).

As a result, my target sprite was changing in between the down/up.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines