I sent the response off a bit too quick. Here is more:

I was actually positively surprised to see it show up. I am a big advocate of strong typing, as it make programming that much more straight forward and helps reduce bugs and errors.

What I wish we would have in Flex/AS3 is a way to have simple 'custom' events (those that don't require additional objects or arguments packaged with it) to self-register through a new class.

Jurgen

justinbuser wrote:

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>, Jurgen Beck <[EMAIL PROTECTED]> wrote:
>
> I know that I can write my own custom event class, but I was wondering
> about something that seems to be undocumented and that seems to
> initially be promising:
>
> When adding a meta tag to an AS class such as:
>
> [Event(name="myEvent",type="flash.events.Event")]
>
> the event shows up when using the class by creating an event listener.
> The interesting thing is that code assist picks it up, but it shows up
> with an altered signature:
>
> myClass.addEventListener(Event.MY_EVENT,myEventHandler);
>
> I wasn't able to find any documentation on it. So I am wondering if
this
> would actually work. At the moment I'm not able to fully test it, as
the
> compiler throws an error with my static class (defined as a singleton)
> stating: Error 1119: Access of possibly undefined property MY_EVENT
> through a reference with static type Class.
>
> If this is legal code, then the question would be how to 'define the
> property' so that the compiler is satisfied.
>
> Does anyone have more information on this?
>
> Thanks,
>
> Jurgen
>
Make your own event class to start, I posted an example on livedocs
here
http://livedocs.adobe.com/flex/201/langref/flash/events/Event.html <http://livedocs.adobe.com/flex/201/langref/flash/events/Event.html> The
capitalization and underscore are an assumption and not actually
defined until you create a class.

Reply via email to