Re: [flexcoders] Re: Dynamic Events (Flex2 Custom Events?)

2005-11-10 Thread JesterXL
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








 Yahoo! Groups Sponsor ~-- 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
~- 

--
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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




RE: [flexcoders] Re: Dynamic Events (Flex2 Custom Events?)

2005-11-10 Thread Matt Chotin










I dont think the example is going
to work since youre 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 dont 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



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











Re: [flexcoders] Re: Dynamic Events (Flex2 Custom Events?)

2005-11-10 Thread JesterXL





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 - 
From: Matt 
Chotin 
To: flexcoders@yahoogroups.com 
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 JesterXLSent: Thursday, November 10, 2005 4:51 
PMTo: flexcoders@yahoogroups.comSubject: 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.comSent: Thursday, November 10, 2005 7:39 
PMSubject: [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 ListFAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txtSearch Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 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



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  









RE: [flexcoders] Re: Dynamic Events (Flex2 Custom Events?)

2005-11-10 Thread Matt Chotin










Clarity of intent, potentially better
performance (at the expense of a slightly larger SWF), strong typechecking as
you use the event in your scripts to name a few.











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Renaun Erickson
Sent: Thursday, November 10, 2005
6:50 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Dynamic
Events (Flex2 Custom Events?)





Good to know, I haven't had time to get through all my testing.
So
what is the difference/benefits of subclassing
Event as your own
custom class and using DynamicEvent class?

--- In flexcoders@yahoogroups.com,
Matt Chotin [EMAIL PROTECTED] wrote:

 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

 
 
 
 
 SPONSORED LINKS 
 
 Web site design development
 http://groups.yahoo.com/gads?t=msk=Web+site+design+developmentw1=Web+

site+design+developmentw2=Computer+software+developmentw3=Software+des
 ign+and+developmentw4=Macromedia+flexw5=Software+development+best+prac

ticec=5s=166.sig=L-4QTvxB_quFDtMyhrQaHQ 
 
 Computer software development
 http://groups.yahoo.com/gads?t=msk=Computer+software+developmentw1=We

b+site+design+developmentw2=Computer+software+developmentw3=Software+d

esign+and+developmentw4=Macromedia+flexw5=Software+development+best+pr

acticec=5s=166.sig=lvQjSRfQDfWudJSe1lLjHw 
 
 Software design and development
 http://groups.yahoo.com/gads?t=msk=Software+design+and+developmentw1=

Web+site+design+developmentw2=Computer+software+developmentw3=Software

+design+and+developmentw4=Macromedia+flexw5=Software+development+best+

practicec=5s=166.sig=1pMBCdo3DsJbuU9AEmO1oQ 
 
 Macromedia flex
 http://groups.yahoo.com/gads?t=msk=Macromedia+flexw1=Web+site+design+

developmentw2=Computer+software+developmentw3=Software+design+and+deve

lopmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=1
 66.sig=OO6nPIrz7_EpZI36cYzBjw 
 
 Software development best practice
 http://groups.yahoo.com/gads?t=msk=Software+development+best+practice

w1=Web+site+design+developmentw2=Computer+software+developmentw3=Softw

are+design+and+developmentw4=Macromedia+flexw5

Re: [flexcoders] Re: Dynamic Events (Flex2 Custom Events?)

2005-11-10 Thread Manish Jethani
On 11/11/05, JesterXL [EMAIL PROTECTED] wrote:

 I'll try using DynamicEvent then isntead; do you have the constructor
 signature handy?

 DynamicEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false)


 Yahoo! Groups Sponsor ~-- 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
~- 

--
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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




RE: [flexcoders] Re: Dynamic Events (Flex2 Custom Events?)

2005-11-10 Thread Matt Chotin










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 were 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 - 



From: Matt Chotin






To: flexcoders@yahoogroups.com






Sent: Thursday, November
10, 2005 9:16 PM





Subject: RE: [flexcoders]
Re: Dynamic Events (Flex2 Custom Events?)











I dont think the example is going
to work since youre 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
dont 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



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.