Another tip is to listen to system-wide bubbling events on systemManager
rather than Applicaion.application, as anything in a popup is not actually
parented by your Application and you'll miss the events. That one bit me
hard before I learned :)
-Josh
On Fri, Jun 13, 2008 at 9:49 AM, Michael Schmalle <[EMAIL PROTECTED]>
wrote:
> Yeah you need;
>
> super(type, true);
>
> Mike
>
> On Thu, Jun 12, 2008 at 7:00 PM, Josh McDonald <[EMAIL PROTECTED]> wrote:
>
>> Events default to not bubbling.
>>
>> -Josh
>>
>>
>> On Fri, Jun 13, 2008 at 8:41 AM, justSteve <[EMAIL PROTECTED]>
>> wrote:
>>
>>> Got it...thx Mike. Forgive the subject-line creep but now I need to
>>> add a listener in a parent of the class dispatching the event. The
>>> subcomponent is derieved from UIComponent...shouldn't it's events
>>> bubble by default? Or perhaps my listener syntax is off:
>>>
>>> addEventListener("isGreaterChanged", isGreaterChangedHandler)
>>>
>>> Am getting no errors just no hits at the parent's event handler method.
>>>
>>> thx again
>>>
>>>
>>> On Thu, Jun 12, 2008 at 9:17 AM, Michael Schmalle
>>> <[EMAIL PROTECTED] <teoti.graphix%40gmail.com>> wrote:
>>> > Hi
>>> >
>>> > package my.event.package
>>> > {
>>> >
>>> > public class MyEvent extends Event
>>> > {
>>> > public static const IS_GREATER_CHANGED:String = "isGreaterChanged";
>>> >
>>> > public var isGreater:Boolean;
>>> >
>>> > public function MyEvent(type:String, isGreater:Boolean)
>>> > {
>>> > super(type);
>>> > this.isGreater = isGreater;
>>> > }
>>> > }
>>> > }
>>> >
>>> > // app as file
>>> >
>>> > [Event(type="isGreaterChanged", type="my.event.package.MyEvent")]
>>> >
>>> > ...
>>> >
>>> > var e:MyEvent = new MyEvent(MyEvent.IS_GREATER_CHANGED, true);
>>> > dispatchEvent(e);
>>> >
>>> > ... event handler
>>> >
>>> > private function isGreaterHandler(event:MyEvent):void
>>> > {
>>> > trace(event.isGreater);
>>> > }
>>> >
>>> > Mike
>>> >
>>> > ---------- Forwarded message ----------
>>> > From: justSteve <[EMAIL PROTECTED]<steve%40stevelearnsflex.com>
>>> >
>>> > Date: Thu, Jun 12, 2008 at 9:51 AM
>>> > Subject: [flexcoders] Understanding Custom Event Creation
>>> > To: flexcoders <[email protected]<flexcoders%40yahoogroups.com>
>>> >
>>> >
>>> >
>>> > The LiveDocs page that is supposed to explain how to create a custom
>>> event
>>> > is:
>>> >
>>> > http://livedocs.adobe.com/flex/3/html/ascomponents_7.html#170959
>>> >
>>> > I get it that what I choose for the name parameter is what listeners
>>> > will have to register against. I don't get the 'type' param. Am I
>>> > needing to make that package of the current class?
>>> > [Event(name="itsGreaterThanZero", type="com.foo.bar.whatHere")]
>>> >
>>> > Also, the sample doesn't make clear how to pass custom (runtime) data.
>>> > I'm working with code that needs to dispatch a custom event when a
>>> > given value is found to be > 0. The method in question is in a class
>>> > that extends UIComponent.
>>> >
>>> > Any help much appreciated.
>>> > --steve...
>>> >
>>> >
>>> >
>>> > --
>>> > Teoti Graphix, LLC
>>> > http://www.teotigraphix.com
>>> >
>>> > Teoti Graphix Blog
>>> > http://www.blog.teotigraphix.com
>>> >
>>> > You can find more by solving the problem then by 'asking the question'.
>>> >
>>>
>>
>>
>>
>> --
>> "Therefore, send not to know For whom the bell tolls. It tolls for thee."
>>
>> :: Josh 'G-Funk' McDonald
>> :: 0437 221 380 :: [EMAIL PROTECTED]
>>
>
>
>
> --
> Teoti Graphix, LLC
> http://www.teotigraphix.com
>
> Teoti Graphix Blog
> http://www.blog.teotigraphix.com
>
> You can find more by solving the problem then by 'asking the question'.
>
>
--
"Therefore, send not to know For whom the bell tolls. It tolls for thee."
:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]