Yes, bubbles is read-only as a property, but
can be set in the constructor of an event type that exposes it (not all Event
subclasses put the variable in their constructor but I think we’re trying
for most Flex classes to do so). Constructor of DynamicEvent is:
DynamicEvent(type:String,
bubbles:Boolean
= false, cancelable:Boolean
= false)
From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of JesterXL
Sent: Thursday, November 10, 2005
8:58 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re:
Dynamic Events (Flex2 Custom Events?)
I was subclassing Event, and Flex 2 told me bubbles was
read-only.
I'll try using DynamicEvent then isntead; do you have the
constructor signature handy?
----- Original Message -----
Sent: Thursday, November
10, 2005 9:16 PM
Subject: RE: [flexcoders]
Re: Dynamic Events (Flex2 Custom Events?)
I don’t think the example is going
to work since you’re trying to dispatch an anonymous object instead of an
Event. Flex 2 requires an Event to be dispatched.
There is mx.events.DynamicEvent which is a
subclass of Event that is dynamic. The constructor does take the
“bubbles” parameter so you can do with it what you will. I
don’t know if any of the events that the components dispatch are dynamic,
I think probably not.
Matt
From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of JesterXL
Sent: Thursday, November 10, 2005
4:51 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re:
Dynamic Events (Flex2 Custom Events?)
I still can't set bubbles =
true, though... bleh....
----- Original Message -----
From: "Renaun Erickson"
<[EMAIL PROTECTED]>
To: <flexcoders@yahoogroups.com>
Sent: Thursday, November 10, 2005 7:39 PM
Subject: [flexcoders] Re: Dynamic Events (Flex2
Custom Events?)
To add arbitrary properties ...
Getting tired ;)
Renaun
--- In flexcoders@yahoogroups.com,
"Renaun Erickson" <[EMAIL PROTECTED]> wrote:
>
> FLEX 2:
> To added Arbitary properties to the Event
object what you can do is
> create your custom Event class that extends
the flash.events.Event like:
>
> package
org.nevis.cairngorm.samples.store.view.checkout {
> import flash.events.Event;
>
> public class ShippingCostChangeEvent extends
Event {
> public var cost : Number;
> }
> }
>
> Then in the MXML you access it like:
>
> <mx:Metadata>
> [Event( name =
"shippingCostChange", type =
>
"org.nevis.cairngorm.samples.store.view.checkout.ShippingCostChangeEvent"
> )]
> </mx:Metadata>
>
> <mx:Button label="Continue"
click="dispatchEvent( { type :
> "shippingCostChange", cost : cost} );"
/>
>
> You could also instantiate your custom class
first and pass that
> through the dispatchEvent.
>
> Not sure if this is what you were asking
about.
>
> Renaun
>
> --- In flexcoders@yahoogroups.com,
"Mark Wales" <[EMAIL PROTECTED]> wrote:
> >
> >
> > Has anyone used them? I've been a bit
confused by several things:
> >
> > DynamicEvent is a subclass (according to
the documentation) of
> > flash.events.Event but is actually found
in mx.events.
> >
> > In addition, the documentation describes
how you can add arbitrary
> > properties at runtime. However,
experimenting with it, it does not
> > appear this works.
> >
> > Is this simply a function of it being an
alpha, am I doing something
> > wrong, or is something else amiss??
> >
> > -Mark
> >
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
YAHOO! GROUPS LINKS