Please remember that if all you need is default behavior as the script you provided does, that is implicitly provided by creating your var public in AS3.
Yes, it feels funny having a public member variable coming from Java since it is bad to expose your objects state. But, if you need to "intercept" the set or get then you can provide the get and/or set method and your other code need not change. You only need getters and setters in Java from the start because there is not implicit mechanism for them. Having getters and setters that are unnecessary and do nothing special just bloats your code. So for that, I see getter and setter generation for Flex/AS3 as unnecessary. One last thing that will surely make eyes roll but...you should be careful when arbitrarily generating getters and setters without considering if that is what you REALLY should do. In the Java world, we too often simply create some fields, generate getters and setters, use the default constructor only. We then use the "class" like a C-style struct with essentially public fields anyway. Keep your mind engaged when developing classes. If you are generating lots of code that you never refactor to something more pertinent to your domain, you have a very 'dead' model. - Todd --- In [email protected], "Gregor Kiddie" <[EMAIL PROTECTED]> wrote: > > I believe this is already on the list of most requested features for > Flex Builder 4. > > In the meantime, you can use snippets to make your life a little easier. > > http://www.insideria.com/2008/04/flex-builder-enhancements-snippets-and- > todo.html > > (Sample snippets code for this) > > private var _${PROP_NAME}; > > [Bindable] > > public function set ${PROP_NAME}( ${PROP_NAME} : ${PROP_TYPE} ) : void { > > _${PROP_NAME} = ${PROP_NAME}; > > } > > > > public function get ${PROP_NAME}() : ${PROP_TYPE} { > > return _${PROP_NAME}; > > } > > () > > > > Gk. > > Gregor Kiddie > Senior Developer > INPS > > Tel: 01382 564343 > > Registered address: The Bread Factory, 1a Broughton Street, London SW8 > 3QJ > > Registered Number: 1788577 > > Registered in the UK > > Visit our Internet Web site at www.inps.co.uk > <blocked::http://www.inps.co.uk/> > > The information in this internet email is confidential and is intended > solely for the addressee. Access, copying or re-use of information in it > by anyone else is not authorised. Any views or opinions presented are > solely those of the author and do not necessarily represent those of > INPS or any of its affiliates. If you are not the intended recipient > please contact [EMAIL PROTECTED] > > ________________________________ > > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of adrianpomilio > Sent: 20 June 2008 02:26 > To: [email protected] > Subject: [flexcoders] A great feature for Flex Builder would be getter > and setter automation. > > > > I use eclipse for Java development and there is a great feature where > you highlight your class variables, right click and select 'generate > getters and setters'. What a time saver. > > Is there any plugins for Flex Builder that will do this? It is > getting annoying to type in the same basic plumbing for every class. >

