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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:55:15+00:00 2026-05-27T17:55:15+00:00

I created a custom event class, and a EventDispatcher-derived class. What i did, is

  • 0

I created a custom event class, and a EventDispatcher-derived class.
What i did, is putting some logic in my EventDispatcher class, and then dispatched the custom event, the problem is i cant manage to listen to the event from my Main app.

I have an Arraycollection which i create and edit in the main app, than i want to send it to the EventDispatcher , and make a few checks, and than i want to dispatch my ArrayCollection back to main app for Binding with Visual objects.

If my entire code logic is incorrect, please tell me [=

Here is some code

The EventDispatcher sub-class

public class LoadData extends EventDispatcher
{
    public var sendData:DataSender = new DataSender('DataLoader',dataList,true);
    private var dataList:ArrayCollection = new ArrayCollection();           
    dispatchEvent(sendData);
}

The custom Event class

public class DataSender extends Event {
    public var data:ArrayCollection = new ArrayCollection;
    public function DataSender(type:String, data:ArrayCollection, bubbles:Boolean=true, cancelable:Boolean=false)
    {
        super(type, bubbles, cancelable);
        this.data = data;
    }
}

The Main app

var DataEvent:LoadData = new LoadData(dataList);
addEventListener('DataLoader',datacapture);


public function datacapture(event:DataSender):void{
    check.dataProvider = event.data;    
}
  • 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-27T17:55:16+00:00Added an answer on May 27, 2026 at 5:55 pm

    You would have to make sure that the event is not dispatched before you actually listen to it. According to your code, it’s not very clear when the event is dispatched.

    Without going into the details of your logic, you could probably do something like this, please note that I’m not recommending this implementation, simply illustrating my answer!

        //In the LoadData Class
        public var sendData:DataSender = new DataSender('DataLoader',dataList,true);
        private var dataList:ArrayCollection = new ArrayCollection();   
    
        public function dispatch():void
        {
           dispatchEvent(sendData);
        }
    
        //In your Main App
        var dataEvent:LoadData = new LoadData(dataList);
        dataEvent.addEventListener('DataLoader',datacapture);
        dataEvent.dispatch();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to fire event in custom class written in Extjs 4. I created
I have created a custom event in my Qt application by subclassing QEvent. class
I have an application that has created a number of custom event log sources
I have created a custom event in flex 3.5. But the handler is not
I've created a custom control with, amongst others, the following: public partial class MyButton
I've created some simple custom ModuleManager in my silverlight application based on PRISM. I
I created a custom view class because I wanted to have a status item
I have created a custom list view and created my own adapter class I
I need some guidance/advices from someone who has any ideea about custom jquery event.
I have created a custom even class which is pretty basic. But when calling

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.