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

  • Home
  • SEARCH
  • 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 50775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:38:46+00:00 2026-05-10T16:38:46+00:00

I have a Flex application where I’m using a Canvas to contain several other

  • 0

I have a Flex application where I’m using a Canvas to contain several other components. On that Canvas there is a Button which is used to invoke a particular flow through the system. Clicking anywhere else on the Canvas should cause cause a details pane to appear showing more information about the record represented by this control.

The problem I’m having is that because the button sits inside the Canvas any time the user clicks the Button the click event is fired on both the Button and the Canvas. Is there any way to avoid having the click event fired on the Canvas object if the user clicks on an area covered up by another component?

I’ve created a simple little test application to demonstrate the problem:

<?xml version='1.0' encoding='utf-8'?> <mx:Application xmlns:mx='http://www.adobe.com/2006/mxml' layout='absolute'>     <mx:Script>         <![CDATA[             private function onCanvasClick(event:Event):void {                 text.text = text.text + '\n' + 'Canvas Clicked';             }              private function onButtonClick(event:Event):void {                 text.text = text.text + '\n' + 'Button Clicked';             }         ]]>     </mx:Script>      <mx:Canvas x='97' y='91' width='200' height='200' backgroundColor='red' click='onCanvasClick(event)'>         <mx:Button x='67' y='88' label='Button' click='onButtonClick(event)'/>     </mx:Canvas>     <mx:Text id='text' x='97' y='330' text='Text' width='200' height='129'/> </mx:Application> 

As it stands when you click the button you will see two entries made in the text box, ‘Button Clicked’ followed by ‘Canvas Clicked’ even though the mouse was clicked only once.

I’d like to find a way that I could avoid having the second entry made such that when I click the Button only the ‘Button Clicked’ entry is made, but if I were to click anywhere else in the Canvas the ‘Canvas Clicked’ entry would still appear.

  • 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. 2026-05-10T16:38:46+00:00Added an answer on May 10, 2026 at 4:38 pm

    The event continues on because event.bubbles is set to true. This means everything in the display heirarchy gets the event. To stop the event from continuing, you call

    event.stopImmediatePropagation() 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 78k
  • Answers 78k
  • 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
  • added an answer From the psql command line interface, First, choose your database… May 11, 2026 at 3:57 pm
  • added an answer Didn't find a workable solution that did everything I needed… May 11, 2026 at 3:57 pm
  • added an answer Upgrading to MVC RC 1.0 seemed to fix ActionLink but… May 11, 2026 at 3:57 pm

Related Questions

I have a Flex application where I'm using a Canvas to contain several other
I have a Flex application that seems larger than it should be. There is
I have built a flex 3 application using Flex Builder. I am then embedding
I have a requirement on my current project (a Flex app which will be
We have a flex application that works with ASP.NET. (through weborb). And we use

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.