Eventhandlers of children of application can not receive custom event dispatched by application

Hello dear Adobe community,
hope you can help me with this issue.
When the application dispatches a custom event, the child uicomponent can only receive the event by using Application.application.addEventListener or systemManager.addEventListener. Simply adding a listener, without application or systemmanager, does not allow the event to be received by the child component.
I want to be able to use the addEventListener and removeEventListener without SystemManager or Application.application, or could you provide a better workaround? How can I use the addEventListener, do I need to overwrite EventDispatcher, which I wouldnt like to do?
Just to clarifiy, if i remove the systemManager in front of addEventListener(CustomEventOne.EventOne,sysManHandleCE,false) it will not add it and will not fire. 
The code below is an example for this problem that the event is not getting fired in the right moment. The mainapplication got only a button with the customEventOne that gets dispatched.
public
class MyCanvas extends Canvas{
public function MyCanvas()
super();
width=300;
height=300;
addEventListener(FlexEvent.CREATION_COMPLETE,handleCC,false,0,true);
private function handleCC(event:FlexEvent):void
removeEventListener(FlexEvent.CREATION_COMPLETE,handleCC);
addEventListener(CustomEventOne.EventOne,handleCE,false,0,true);
addEventListener(Event.REMOVED_FROM_STAGE,handleEvt,false,0,true);
systemManager.addeventListener(CustomEventOne.eventOne,sysManHandleCE,false,0,true);
private function handleEvt(event:Event):void
trace("In removed from stage handler");
systemManager.removeEventListener(CustomEventOne.EventOne,sysManHandleCE);
trace(hasEventListener(FlexEvent.CREATION_COMPLETE));
trace(hasEventListener(CustomEventOne.EventOne));
trace(hasEventListener(Event.REMOVED_FROM_STAGE));
private function handleCE(event:CustomEventOne):void
trace("I got it");
private function sysManHandleCE(event:CustomEventOne):void
trace("I got it");
public class CustomEventOne extends Event
public static const EventOne:String = "EventOne";
public function CustomEventOne(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
super(type, bubbles, cancelable);
override public functionclone():Event
return newCustomEventOne(type,bubbles,cancelable);
Thank you in advance,
Michael

I think you need to look at event propogation. The object that dispatches an event will be sitting on the display tree. The event propagates up the tree to the roots. Your canvas should be attached to the application, but even then it sits lower in the tree branches than the event dispatcher, so it won't see the event being dispatched because the event is not propagated to the children of the object that dispatches it but to the parent of the object that dispatches it.
So, your canvas is a child of the application, but dispatching the event from the application means that the canvas doesn't see it because events are notified up the tree using the parent link, not the child links.
You may wish to investigate how the display list and event propagation works and then the MVC pattern.
Paul

Similar Messages

  • MovieClip does not receive Custom Event

    I have a problem understanding Events and event handling.
    I have a movieClipA wich contains several other movieClips (a1,A2,A3, etc..)
    MovieClipA is parent of movieClips (a1,A2,A3, etc..)
    In movieClipA I use the following code:
    addEventListener ( "Pieter", pieterFnP ) ;
    dispatchEvent(new Event("Pieter"));
    private function pieterFnP (e:Event) {
            trace ("PIETER - Parent");
    } // Is fired when recieving Event
    In movieClips (a1,A2,A3, etc..) I use the code
    addEventListener ( "Pieter", pieterFnC ) ;
    private function pieterFnC (e:Event) {
             trace ("PIETER - Child");
    } // Is NOT fired ?
    When I execute the application, function "pieterFnP" is fired, but "pieterFnC" NOT.
    Thank you.
    Pieter

    In the Flash manuals I see/read; events traveling from the stage down to the object and then bubling up.
    Quote::
    When an event occurs, it moves through the three phases of the event flow: the capture   phase, which flows from the top of the display list hierarchy to the node just before the   target node; the target phase, which comprises the target node; and the bubbling phase,   which flows from the node subsequent to the target node back up the display list hierarchy.
    My First attempt was Capturing events send by the Child objects. But then I had the problem that after the child object was gone, the eventhandler stil existed. Pointing to a null Child object. This behaviour is also described in the Flash manuals. But I never could pin-point which variable (object) still contains a 'reference' ? to the event object.
    So I thougth about a different approach. Which seams to me, was the logical solution, meaning Bubbling down and up.
    My design approach was to define a child DisplayObject, which perform some action, after recieving a event from is parent. So I don't have to keep track of all the created objects. More like the Idea of fire and forget.
    Ok, I go back to my virtual drawing board
    Thanks,
    Pieter

  • Can not receive data 10054

    My version of Essbase is 6.5.1.4. On the server machine it self when I am adding members to outline I get "Can not receive data 10054". To resolve this problem I tried to increase the server page file size but the problem persist.Does anyone know a solution to this problem?SAK

    How exactly are you retrieving data; is it smartview, excel addin, forms, reports etc ?

  • Can not receive Mac mail -error Outlook cannot find the server. Verify the server information is entered correctly in the Account Settings, and that your DNS settings in the Network pane of System Preferences are correct.  Account name: "MacMail"

    Can not receive Mac mail -error Outlook cannot find the server. Verify the server information is entered correctly in the Account Settings, and that your DNS settings in the Network pane of System Preferences are correct.  Account name: "MacMail"
    What are the correct mail account settings and more importantly the correct DNS settings
    Thank you for any help you may be able to provide
    Cheers
    Chris (iMac i7)

    Do not delete the old account yet. sign up for an iCloud account if you haven't.
    I understand .mac mail will still come through. Do not delete the old account yet.
    You cannot use .mac or MobileMe as type of Account, you have to choose IMAP when setting up, otherwise Mail is hard coded to change imap.mail.me.com to mail.me.com & smtp.mail.me.com to smtp.me.com, no matter what you try to enter.
    iCloud Mail setup, do not choose .mac or MobileMe as type, but choose IMAP...
    On second step where it asks "Description", it has to be a unique name, but you can still use your email address.
    IMAP (Incoming Mail Server) information:
              •          Server name: imap.mail.me.com
              •          SSL Required: Yes
              •          Port: 993
              •          Username: [email protected] (use your @me.com address from your iCloud account)
              •          Password: Your iCloud password
    SMTP (outgoing mail server) information:
              •          Server name: smtp.mail.me.com
              •          SSL Required: Yes
              •          Port: 587
              •          SMTP Authentication Required: Yes
              •          Username: [email protected] (use your @me.com address from your iCloud account)
              •          Password: Your iCloud password
    Also, you must upgrade your password to meet the new criteria:  8 characters, including upper and lower case and numbers.  If you have an older password that does not meet these criteria, when you try to setup mail on your mac, using all of the IMAP criteria listed above, it will still give a server error message.  Go to   http://appleid.apple.com         then follow directions to change your password, then go back to setting up your mail using the IMAP instructions above.
    Thanks to dpepper...
    https://discussions.apple.com/thread/3867171?tstart=0

  • TS3276 Mail account set up. Can not receive mail-Everything is green in Connection doctor but when checking activity it shows stop signs.  Was able to receive mail until last week  then all of a sudden stopped receiving mail but no changes were made.

    My mail account has been set up and working to send and receive mail for several months.  All of a sudden I can not receive mail.  The connection doctor shows all green lights.  No changes have been made and nothing has been changed on preferences on IMAP and SMTP.  I can send mail.  My other accounts all send and receive mail.  When you click on activity the list shows stop signs. All accounts show that they are online. 

    UPDATE:
    I deleted all the messages off the server of the offending email address and everything works fine now.

  • TS4268 I CAN NOT RECEIVE TEXT MESSAGES FROM PEOPLE USING IMESSAGE - I HAVE MY IMESSAGE TURNED OFF BECAUSE I DO NOT WANT TEXTS GOING TO ALL MY ACCOUNTS - HOW DO I RESOLVE THIS PLEASE HELP - MISSING SEVERAL IMPORTANT COMMUNICATIONS...

    I CAN NOT RECEIVE TEXT MESSAGES FROM PEOPLE USING IMESSAGE

    On an iPhone your iMessages will go to your phone number.
    You can select another email to use on iPod or iPad.
    Go to settings
    Messages
    Send and receive
    Check your phone number and uncheck the common Apple ID you share so your messages will not go to other devices.

  • Can not receive emails from third party email accounts

    Recently I started working for a small business which has small business server 2011 and exchange 2010 installed. Before I started there were eight user accounts and they all have unlimited email access. I created a few users through sbs AD and also from
    exchange console a week ago. Unfortunately none of them can not receive emails from third party accounts. they all can receive internal emails and also can send mails to any email accounts internally and externally. 
    This is a night mare for me as new users are having trouble with communicating via mails. I have tried all the methods and now thought of posting this issue on tech net. Please help me on this!!
    Thanks a lot!! 
    Sammy 

    Checklist for testing inbound email problems, I am assuming outbound emails works ok.
    1. Check Port 25 forwarding on all modems routers/firewalls
    2. MX Record is created and pointing to the correct Public IP Address, use MXToolbox.com to verify MX Record and test SMTP flow. Also Verify your public IP has not changed, use whatsmyip.org to check you public IP
    3. If using POP Connector Service, make sure POP accounts are created properly
    4. If using a 3rd party spam host, make sure they forward email to correct public IP address, use step 2 to verify your public IP.

  • All of a sudden I can not receive text messages on my MOTOX. Does anyone know how to solve this problem. I can send them, but can't receive them.

    My MOTO X was working fine, then all of a sudden, I can not receive text messages. I have checked the settings and they look correct to me, and I have done everything the web site recommends, except wiping the phone and starting over, to try and fix it. Has anyone else had this issue, and how did you resolve it?
    Thanks so much.

        That's strange that your Moto X wont receive any text. Thank you for trouble shooting the issue. Let's see what's going on! Does your device have any physical or liquid damage? Does anyone else have an issue with calling or texting? What zip code are you in?
    VanetrisC_VZW
    Follow us on Twitter @VZWSupport

  • (HELP~) Most applications can not be executed

    Hi, after updating my OSX 10.6.4, most applications (such as iTunes, iPhoto, Pages, Firefox... etc.) can not be executed. They always shows that the application can not be executed on this OS, even I had checked my MAC HD.
    However, when I swith to bootcamp OS (Windows XP sp3), everything goes fine.
    How can I fix it?
    Thank you all.

    Create a new User go to System Preferences > Accounts > "+" (make it an admin acct) and test the apps in this new account, if they work the problem is isolated to your User and not systemwide.
    If the issue is limited to your user account try starting up Safe Mode (It will take more time to startup in Safe Mode because it runs a directory check.)
    If your apps functions correctly that way, go to System Preferences >> Accounts >> Login Items, and remove them. Boot normally and test. If not go to/Users/yourname/Library/Contextual Menu Items and move whatever is there to the desktop. Then do the same with /Library/Contextual Menu Items. Lastly, try moving/Users/yourname/Library/Fonts to your desktop and restarting.
    Log out/in or restart, if that sorts it start putting items back one at a time until you find the culprit.
    If the issue is systemwide then, you may be able to repair this with the The 10.6.4 Combo Update This is a fuller install, as opposed to an incremental "delta" update so it should overwrite any files that are damaged or missing. It does not matter if you have applied it before.
    Remember to Verify Disk before update and repair permissions after update from /Applications/Utilities/Disk Utility.
    -mj

  • MFP M127fn can not received fax from sleep

    I can not receive fax when printer go to sleep.
    I already upgraded lastest firmware, turn on fax event, the printer is connected directly to a wall outlet but still not working.
    There is no option to turn off auto sleep feature.
    Please help . Thanks

    I am having a similar problem. Once the printer goes to sleep, I cant get it to wake up even if I press the screen or power button on the printer itself. The only way to get it to print once it goes to sleep is by unplugging it and plugging it back in.

  • Please Help!! Can not receive College student coupons emails for waiting a long time

    Hello,
    I can not receive the college student coupon emails after I signed in for a while. And I tried a couple of times, but it still won't work. I check the solutions which you guys post on the Forum, but it won't work for me. So I really need someone help me please!! Thank you so much! Because I saw you post a good deal for ipad right now, and I don't want to miss it this time....
    Sincerely,
    V

    Hello V,
    The College Student Deals program certainly has some great offers and I would do almost anything to get a good deal on an iPad! Sorry to hear you haven’t received an email with these coupons. I would like to help you take advantage of those deals!
    Using your email address you provided here on the forums, I was able to see that you received some assistance in this matter today. Is that correct? Please let me know if you still need help with this and I will gladly look into it for you further.
    In the meantime, you may try checking your Junk/Spam folders in your .edu email address if you haven’t done so already. Also, I recommend speaking to your school’s IT department to see if they have been blocking the emails altogether, as this has been known to happen by certain schools. I should be able to supply you with the email address they are sent from if you need it for reference.
    I look forward to your response,
    JD|Social Media Specialist | Best Buy® Corporate
     Private Message

  • I start the computer the screen has blue vertical stripes and says that the Adobe Air application can not be found. Some of my programs don't run and say: You: Error access violation at 0x0055F525

    I start the computer the screen has blue vertical stripes and says that the Adobe Air application can not be found. Some of my programs don't run and say:
    You: Error access violation at 0x0055F525. I reinstalled Adobe Air. No change. I went to the Adobe webside and they said to repair it with a program. I bought RegCure. Didn't change anything. What to do?

    Hello cor-el, thanks for your reply. I changed my settings for downloads to desktop and it has appeared on there. When I double click I am asked which program I want to open file. I click firefox and another box "opening install" says I have chosen to open the file which is an application and do I want to save it. This is the only real option so I press save file. I get a box saying this is an executable file which may contain viruses - do you want to run. I press ok and the final box showing C drive file name and desktop appears stating application not found.
    This happens the same whenever I try to install.
    To my untrained eye the application is not being recognised as an application and I cannot work out how to get it to do that.
    My plugin is still showing as out of date.
    Is there anything you could suggest. Thanks for your time.

  • Jre6u27 win7 (64) applications can not detect

    windows7 x64
    I had jre7.x version installed. And it works fine.
    Once I removed this version and installed jre6.27 (in fact, when install jdk6.27), applications can not find jre.
    "JAVA_HOME" is set.
    "Path" contains path to jre & jdk (i was try any varyations also with '\bin' subfolders).
    javac run from any location.
    The registry has all nessesary mentions jre & jdk.
    But, nevertheless, applications does not detect jre.
    Please help! Any suggestions are welcome.
    fyi: javaFX 2.0.2 with sdk also installed in system.

    I tried every thing
    updated my bios
    tried in device manager
    tried in any mode you like
    tried to install the latest drivers that support windows7

  • I can not resume when I downloaded the application from the Apple Store. If I have to start from the beginning of a solution to this too please.

    I can not resume when I downloaded the application from the Apple Store. If I have to start from the beginning of a solution to this too please. ?

    Are  you away from your home country?
    Settings > General > International > Region Format > set to correct location?
    Settings > Phone > Dial Assist > ON

  • Why the bottom of the screen of my ipod can not be used to open the application but the application could be to shift

    why the bottom of the screen of my ipod can not be used to open the application but the application could be to shift, please help me

    Try:
    - Reset the iOS device. Nothing will be lost      
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Restore from backup. See:                                               
    iOS: Back up and restore your iOS device with iCloud or iTunes
    - Restore to factory settings/new iOS device.                       
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar                                                              

Maybe you are looking for

  • Soundtrack Pro is Not Opening

    I am having a problem opening Sound Track Pro. I am using version 1.1 (Final Cut Studio 1) and this is the second time I have had this problem. Double clicking on the program, it tries to open, then I get the message "Soundtrack Pro has unexpectedly

  • I just installed itunes on my pc.  Can't find Store menu or authorize my computer.  Help!

    I have itunes on my ipad and just bought a new PC laptop with Windows 7.  I have already downloaded itunes on my comuter, but need to authorize it.  Support says to go to Stores menu and choose authorize my computer.  Problem is....I can't find the S

  • Aironet access-point 1231G reboots itself frequently...

    Hi there, We have one 1231G access-point which reboots itself after every certain time, its uptime has never crossed some 30 - 35 mins, usually it remains to 10 -15 mins. Some days ago, I saw a similar problem being discussed on thsi plateform but af

  • Aperture 3 and Facebook exporting???  doesn't update

    So I tried the new Facebook exporter from Aperture 3. You can only put pics in a new Facebook album, or drag them into an album that you have created from within Aperture 3. But when I add photos by dragging them, they do not show up on Facebook. Ape

  • Discoverer parameter issue

    I need to use the same pair of parameters for a query composed by "union all" with three independent queries. Consider the following example: create table docs(supplier varchar2(20), doc_date date, doc_num varchar2(10), amount number); insert into do