RE: [Flashcoders] Custom eventListener

2008-12-19 Thread Lehr, Ross (N-SGIS)
Thanks all. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Muzak Sent: Friday, December 19, 2008 12:38 AM To: Flash Coders List Subject: Re: [Flashcoders] Custom eventListener You might wanna read

RE: [Flashcoders] Custom eventListener

2008-12-19 Thread Merrill, Jason
Maybe I am slow... or even dumb? But all those things I can do with normal events, I guess. I was simply showing you a simple example of how you would have a custom class broadcast a custom event... normally you would not use normal events like the mouse event kind for that kind of situation.

RE: [Flashcoders] Custom eventListener

2008-12-19 Thread Merrill, Jason
and subscribe. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor Sent: Thursday, December 18, 2008 5:42 PM To: 'Flash Coders List' Subject: RE: [Flashcoders] Custom eventListener Jason: This is all simplified

Re: [Flashcoders] Custom eventListener

2008-12-19 Thread John McCormack
Re: [Flashcoders] Custom eventListener thread is an interesting topic but it has attached itself to the Re: [Flashcoders] Pixel precise thread In Mozilla's Thunderbird I sort on topic and so I miss these fascinating discussions because the threads are mangled. Does it mess up the archives when

RE: [Flashcoders] Custom eventListener

2008-12-19 Thread Lehr, Ross (N-SGIS)
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Lehr, Ross (N-SGIS) Sent: Friday, December 19, 2008 9:04 AM To: Flash Coders List Subject: RE: [Flashcoders] Custom eventListener Thanks Jason... Let me ask one question to try to clarify this for me. If I have the dispatchEvent

Re: [Flashcoders] Custom eventListener

2008-12-18 Thread David Hershberger
An event is just a message object. Just because one gets created successfully does not mean it is being delivered. dispatchEvent() is a method of the EventDispatcher class, which is a superclass of many classes, including DisplayObject. You need to listen for the event (with addEventListener())

RE: [Flashcoders] Custom eventListener

2008-12-18 Thread Merrill, Jason
To: Flash Coders List Subject: Re: [Flashcoders] Custom eventListener An event is just a message object. Just because one gets created successfully does not mean it is being delivered. dispatchEvent() is a method of the EventDispatcher class, which is a superclass of many classes, including

RE: [Flashcoders] Custom eventListener

2008-12-18 Thread Merrill, Jason
, December 18, 2008 5:27 PM To: 'Flash Coders List' Subject: RE: [Flashcoders] Custom eventListener Thanks Ross and Jason! Now I understand this. But I am trying to imagine when I would use a custom event. I have no idea? Could you give an example? Kind regards Cor -Original Message- From

RE: [Flashcoders] Custom eventListener

2008-12-18 Thread Cor
] On Behalf Of Merrill, Jason Sent: donderdag 18 december 2008 23:20 To: Flash Coders List Subject: RE: [Flashcoders] Custom eventListener To add on to David's fine reply, Ross, you're close, but not quite - this is how I write custom events, I think you'll want to do something like this instead

RE: [Flashcoders] Custom eventListener

2008-12-18 Thread Cor
Jason: This is all simplified, advanced coders would use some design patterns or frameworks to handle all this, but you get the idea. Maybe I am slow... or even dumb? But all those things I can do with normal events, I guess. So what I mean was an example of something you cannot do with normal

Re: [Flashcoders] Custom eventListener

2008-12-18 Thread Glen Pike
Hi, I use custom events to pass data around - here is a simple example: package events { import flash.events.Event; public class GameEvent extends Event { public var score:int; public static const GAME_OVER:String = Game Over; public function

Re: [Flashcoders] Custom eventListener

2008-12-18 Thread David Hershberger
I use custom events mostly when I have data to pass through the event which doesn't fit nicely into some pre-defined one. For instance, we have a HighScoreEvent which has the number of points and the time it took to finish the game. Also, it is good practice to define your own Event subclass(es)

Re: [Flashcoders] Custom eventListener

2008-12-18 Thread Muzak
...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: donderdag 18 december 2008 23:20 To: Flash Coders List Subject: RE: [Flashcoders] Custom eventListener To add on to David's fine reply, Ross, you're close, but not quite - this is how I write custom events, I think you'll want to do