Hi,

For that you need to add a listener that uses capture. Remember the 3
phases in event processing "capture-target-bubble"
But use to add a concrete listener for a concrete event from a component,
instead of use capture.

Moreover, in real apps, we really don't do that either, we use frameworks
like Crux. Please check presentations here:

https://apache.github.io/royale-docs/presentations/presentations.html

in Concrete this:


   - Starting from a blank file <https://youtu.be/E-Fg5V5DxbY> - How to
   build a brand-new application using Royale’s off-the-shelf resources. PDF
   of the slide presentation
   
<https://apache.github.io/royale-docs/presentations/StartingFromABlankFile-ApacheCon2020.pdf>

Where I talk about using Crux

https://apache.github.io/royale-docs/presentations/StartingFromABlankFile-ApacheCon2020.pdf

In "Event Handling" and "The Controller" slides, you can see the Crux
style through metadata:

[EventHandler(event="TodoEvent.ADD_TODO_ITEM", properties="todo")]
public function addTodoItem(todo:TodoVO):void {
    model.allItems.addItem(todo);
   saveDataToLocal();
   updateInterface();
}

So in short, you have a Controller (MVC typical app design), where you have
the controller methods that are "annotated" with metadata. Crux know about
that events and is capable to listen from views (since crux knows about the
views and can listen). So when a concrete event is thrown from a view the
controller is capable to run a particular method.

HTH


El vie, 29 ene 2021 a las 21:26, Bilbosax (<[email protected]>)
escribió:

> Brilliant, Carlos.  Thanks.
>
> I ran a little test and was easily able to catch events that bubbled up
> from
> a component to the Main.mxml.  But what if I wanted to dispatch an event
> from Main.mxml that I want a component below it to catch?
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Reply via email to