1 Answer

  1. Leo- Reply

    2019-11-15

    Most likely cause in this situation:

    Your custom class that extends EventDispatcher is not on the display list - eg. the instance of it is not a child/descendant of your main timeline.

    When an event bubbles, it bubbles up the display list parentage until it reaches the main stage. If the object dispatching the event is not a display object with a parent, there will be no bubbling.

    You can either add the event listener to the instance of the custom class that loads data:

         myCustomClassThatLoadsData.addEventListener("bam",getResults);
    

    Or pass in a reference to a display object (main class, main stage, etc) to dispatch the event on.

    stage.addEventListener("bam",getResults);
    myCustomClassThatLoadsData = new CustomClassThatLoadsData(stage);
    
    //in the custom class
    stageReference.dispatchEvent(new Event("bam"));
    

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>