Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 610665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:41:59+00:00 2026-05-13T17:41:59+00:00

I am programming a little software prototype as Flash/Actionscript3 application. Currently I registered some

  • 0

I am programming a little software prototype as Flash/Actionscript3 application. Currently I registered some Events on stage – but it is cumbersome since stopPropoagation() needs to be used all the time.

As Example:
I am having a element shown via mouseclick would and a event for closing the menu on stage. Without using stopPropagation, the menu opens and closes again immediately. The hide-function is registered on some objects so just checking if target= stage would not do it, unfortunately.

Are there any good solutions to get around this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:42:00+00:00Added an answer on May 13, 2026 at 5:42 pm

    So you have a listener for a MOUSE_CLICK on the stage thats getting fired when you click on an ‘element’.

    Which looks something a bit like:

    addEventListener(MouseEvent.CLICK, onClick)
    function onClick(e:MouseEvent)
    {
        trace("CLICK")
    }
    mc.addEventListener(MouseEvent.CLICK, onMcClick)
    
    function onMcClick(e:MouseEvent)
    {
        trace("mc")
        e.stopPropagation();
    }
    

    If thats the case then yes, stage will always recieve this event since it has to do with how native flash events propogate and bubble. http://www.adobe.com/devnet/actionscript/articles/event_handling_as3_03.html

    Instead of listening to the stage and having to call stopPropogation you can restructure your code. You will need to remove the listener on the stage and instead add it to the actual item so:

    mc2.addEventListener(MouseEvent.CLICK, onClick)
    
    function onClick(e:MouseEvent)
    {
        trace("CLICK")
    }
    
    
    mc.addEventListener(MouseEvent.CLICK, onMcClick)
    
    function onMcClick(e:MouseEvent)
    {
        trace("MC 2 CLICK")
    
    }
    

    Of course this might then require you to change some of your other code but since I can’t see it I am not sure what that is. Just remember that events propogate and bubble. So if you had a movieclip ‘c’ inside a movieclip ‘b’ thats on stage, and both c and b have listeners for a MOUSE_CLICK then if you click on c then both b and c events will recieve this event since it bubbles up the display list. But if c was not in b but c was on the stage and b was on the stage then this would not happen since b is not on the path for the bubbling of c. Hope that helps 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 379k
  • Answers 379k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Checkout the book "High Performance MySQL". There are a lot… May 14, 2026 at 9:34 pm
  • Editorial Team
    Editorial Team added an answer For single master, multi-slave it's often as simple as sending… May 14, 2026 at 9:34 pm
  • Editorial Team
    Editorial Team added an answer MVC has obviously existed long before Rails or ASP.NET MVC.… May 14, 2026 at 9:34 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.