The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 5 of 5

Thread: [AS3] Mouse event question

  1. #1

    [AS3] Mouse event question


    Heres my situation:

    btn (Sprite)
    ---> text (TextField)
    ---> back (Sprite)

    I added MouseEvent.MOUSE_OVER event listener to the 'back' sprite, but it doesn't get called, because the 'text' element is in front of it.
    I want to keep the event firing only when mouse is over the 'back', so I can't add eventlistener to the 'btn'.

    I could put some transparenet duplicate of 'back' in front of the 'text' and add listener there, but I believe there should be a more elegant solution.

    Maybe there is some way to exclude an element from the whole capture/bubble event procedure?


  2. #2
    try looking up the mouseChildren property of DisplayObjects. see if that will work for your case

  3. #3
    I tried that, no results

    I think the problem is that 'text' and 'back' are not in the parent/child relation and mousevent handler is processing the wrong branch ("stage - btn - text" instead of "stage - btn - back").
    At least that's how I understand this whole new event system


  4. #4
    well, from memory, even if text is in front, the event will still fire on back. Have you tried/

    Also, if MOUSE_OVER doesn't work, try ROLL_OVER. if MOUSE_OVER is a bubbling event, ROLL_OVER is a capture phase event. Ijust can't remember

  5. #5
    I've tried that too No go

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012