I think some ActionScript developers simply prefer the use of regular setVar() getVar() instance methods instead of the AS3 get set keywords because they know what's going on in their own code.
I remember going to Colin Moock's AS3 1 day crash course last year in Toronto and he said that while there was nothing wrong with either method, he preferred regular getVar() setVar() instance methods because he felt more in control over his own code. With AS3 get set keywords, AS probably does a bunch of things "in the back" that you're not aware of to make it work as expected. This is probably the same kind of debate as the tabs vs spaces debate. Both ways are OK, simply stick with the one you prefer... --- On Tue, 12/9/08, allandt bik-elliott (thefieldcomic.com) <[EMAIL PROTECTED]> wrote: > From: allandt bik-elliott (thefieldcomic.com) <[EMAIL PROTECTED]> > Subject: Re: [Flashcoders] use get / set functions or make your own > To: "Flash Coders List" <[email protected]> > Date: Tuesday, December 9, 2008, 6:28 AM > i would have to agree - i use the built in ones and > can't see any benefit > from using bespoke ones apart from maybe being able to use > the variable name > i want rather than adding extra characters to it (although > i use a leading > underscore for class variables anyway) > > On Tue, Dec 9, 2008 at 10:48 AM, Ian Thomas > <[EMAIL PROTECTED]> wrote: > > > I use Actionscript getters and setters. > > > > Because I can start off using ordinary public > properties, and change > > them into getters and setters if I need more > control/notification > > without changing any of the code that _uses_ my class. > > > > In order to achieve that otherwise, I'd have to > make a getValue() and > > setValue() for every single public property (as is > done in Java). And > > a fair few of those would simply be > this._property=value (setter) or > > return this._property (getter) i.e. essentially just > placeholder > > methods that bloat the code. > > > > The beauty of the actionscript get and set functions > is that they are > > indistinguishable from public properties from the > outside of the > > class. It's a huge improvement over Java. > > > > Ian > > > > On Tue, Dec 9, 2008 at 10:24 AM, allandt bik-elliott > > (thefieldcomic.com) <[EMAIL PROTECTED]> wrote: > > > hi guys > > > > > > quick poll - Do you use the actionscript > getter/setter functions or do > > you > > > make your own, and why. > > > > > > I've noticed with a lot of the public domain > code (like SWFAddress, for > > > instance) that you see a lot of 'public > function getVariable()' type > > getters > > > instead of using the flash 'public function > get variable()' adobe > > > recommended getters(and setters) and i was > wondering why people do this? > > > > > > thanks > > > a > > > _______________________________________________ > > > Flashcoders mailing list > > > [email protected] > > > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > _______________________________________________ > > Flashcoders mailing list > > [email protected] > > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > _______________________________________________ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

