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 803765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:48:42+00:00 2026-05-14T23:48:42+00:00

I have such problem: I have 2 custom components, which have their own nesting

  • 0

I have such problem:
I have 2 custom components, which have their own nesting hierarchy … One is container for another. I have to “familiarize them” with each other. The way I’m trying to achieve that is using global events (one side is firing and the other one is catching):

Application.application.addEventListener("Hello", function (data:Event):void{
        // .. some actions
    });

//and
Application.application.dispatchEvent(new Event(Hello));

Everything is pretty good, but there’s one thingy .. when I’m trying to catch the event, I can’t access the class, who is catching it. E.g.:

  1. Container fires the event.
  2. Child caughts it.
  3. Then should be created the connection between container and it’s child.

BUT, the only thing I could acheive is passing a reference to the Container in the DynamicEvent. Is there any chance that I could access the child at the event-handler function.
Or maybe there’s more elegant way to solve this problem …

Any help would be greately appreciated 🙂

  • 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-14T23:48:43+00:00Added an answer on May 14, 2026 at 11:48 pm

    In most cases, either target or currentTarget will give you access to the component that is firing the event.

    http://livedocs.adobe.com/flex/3/langref/flash/events/Event.html
    http://livedocs.adobe.com/flex/3/langref/flash/events/Event.html#currentTarget
    http://livedocs.adobe.com/flex/3/langref/flash/events/Event.html#target

    However, with your approach, you are firing the event from the top level application; not from either of your nested components. This strikes me as unusual.

    I envision you have a hierarchy like this:

    Application

    — Container1

    ——-Container2

    I would recommend firing the event from container2 and listening for it in container1.

    Your dispatch code in Container2 will be something like this:

    this.dispatchEvent(new Event('myCustomEvent'));
    

    In container1 you can listen for the event something like this:

    container2.addEventListener('myCustomEvent', onMyCustomEvent);
    

    If you do need to add custom event data to your event; you can create your own custom event class and add data. Do you have a specific use case for firing the events off the Application container? I’d love to hear it.

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

Sidebar

Related Questions

everyone The problem is if there exists two exported components which have the same
I have my own custom control derived from System.Windows.Forms.TreeView which is present on the
I have such problem: I'm using rails, devise gem and jQuery validation plugin. I
So, i have such problem: first time, then the <a> get clicked e.preventDefault() isn't
I have such a basic problem in Delphi,I can't solve it. My Code: Note:DataR
I have a problem such that i have zip files uploaded from forms and
I have some problem whith such mysql_query INSERT INTO table VALUES ('', CURDATE()-1) why
I have some complicated, problem to be solved. Now I need to write such
I have such XML structure which was returned by SharePoint web services. <rs:data ItemCount=4
Hey I have a problem getting my head around how custom GWT event Handlers

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.