Initially I was wary of the built in get and set framework, but I came
to really like this technique. For example, you want to update the
score of your game, but doing so requires touching numerous gui
elements and properties. Using the built in setter methodology allows
you to abstract and simplify the API call.
score ++;
score += 10;
score --;
> On 4/26/06, Jim Tann <[EMAIL PROTECTED]> wrote:
> >
> > Hello all,
> >
> > After a long time of trying to figure which method of using getters &
> > setters is better I though the best way to get a good answer is to throw
> > it open to the list.
> >
> > Do you prefer to use the inbuilt getter & setter functionality?
> > i.e.
> >
> > public function get myProperty():Number{ return _myProperty; }
> > public function set myProperty(intSet:Number):Void{ _myProperty =
> > intSet; }
> >
> > or do you prefer using normal functions?
> > i.e.
> >
> > public function getMyProperty():Number{ return _myProperty; }
> > public function setMyProperty(intSet:Number):Void{ _myProperty = intSet;
> > }
> >
> > I like the first method as it looks cleaner, but there have been issues
> > with inheritance where if you overwrite either the getter or setter, but
> > not both in the child class it gets ignored.
> >
> > What are your views?
> > Jim
> > _______________________________________________
> > [email protected]
> > To change your subscription options or search the archive:
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> > Brought to you by Fig Leaf Software
> > Premier Authorized Adobe Consulting and Training
> > http://www.figleaf.com
> > http://training.figleaf.com
> >
> _______________________________________________
> [email protected]
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com