[osflash] Exceptions in as2 : bad or good

Chris Allen mrchrisallen at gmail.com
Sun Aug 27 21:55:19 EDT 2006


On 8/27/06, Ralf Bokelberg <ralf.bokelberg at gmail.com> wrote:
> ... but passing events up a deeply nested call chain is a pain, isn't it?
> it's surely possible, but much more code.
>
For what it's worth, I usually take this event broadcasting approach
with AS2, if you accept that most stuff is event based and style your
code to that it's not too cumbersome. But, I would love to see better
support of Exceptions in ActionScript. Even AS3 hasn't taken it as far
as it should to make it useful IMO.

> cheers,
> ralf.
>
> On 8/27/06, Martin Heidegger <mastakaneda at gmail.com> wrote:
> > > For me, the main point of using exceptions is the possibility to pass
> >
> >
> > > the control up the call chain.
> >
> >
> > I usually use events for those kinds of problems because they are usually
> > better for visualisation.
> > I mean like:
> >
> >   .onXmlParseError
> >   .onFileNotFound
> >   .onConnectionNotPossible
> >
> > because those are on one hand better readable and on the other hand there is
> > better support
> > for events than for exceptions. So it matches a little better in my
> > workflow. I hide this way the
> > problems too from the unnecessary code parts because they just are not going
> > to be called.
> >
> >   .onXmlParseReady -> builtTree (only gets called if everything was fine
> >
> > yours
> > Martin.
> >
> > _______________________________________________
> > osflash mailing list
> > osflash at osflash.org
> > http://osflash.org/mailman/listinfo/osflash_osflash.org
> >
> >
> >
>
>
> --
> Ralf Bokelberg <ralf.bokelberg at gmail.com>
> Flex & Flash Consultant based in Cologne/Germany
>
> _______________________________________________
> osflash mailing list
> osflash at osflash.org
> http://osflash.org/mailman/listinfo/osflash_osflash.org
>



More information about the osflash mailing list