One way can be to add an event listener of each ball instance with the
parent
application using the parentapplication handle.
parentapplication.addEventListener(customevent, handler);
you can do it in the creationcomplete method of the ball instance.
When you capture the mouse event, just dispatch a custom event with the
parent
application
parentapplication.dispatchevent(customevent);
Other way could be to define a global bindable variable and use mx:binding
to bind methods to its
value change.Eg
<mx:Binding source="{boundVar}" destination="setMainWindow"/>
The method specified in destination will be triggered when you change the
bound value
in the mouse click event.
~Peeyush
On Jan 3, 2008 9:29 AM, jrag0n <[EMAIL PROTECTED]> wrote:
> I get the sense this is very easy, but I haven't been able to make it
> work yet.
>
> When I click a button, a ball is sent out on the screen and starts moving
> randomly. I want to
> press a button and have every ball on stage do something, like all get
> twice as large, or all
> turn white or something.
>
> I assume I'm going to capture a MouseEvent.CLICK on the stage, which then
> targets all the
> balls I've dynamically created, and then each ball can respond
> accordingly. But I'm stuck. Any
> thoughts?
>
>
>