Send to a Friend

jmdecombe's avatar

Does not implementing a setter method in ActionScript 3 make the property unsettable?

Asked by jmdecombe (9points) October 6th, 2009

Assuming that I define an ActionScript 3 class as follows:

package com.fluther {
public class Fluther {
private var _property:Object;
public function Fluther (property:Object) {
this.property = property;
}
public function get property ():Object {
return _property;
}
}
}

Does the lack of a set method for property make property unsettable except through the constructor? If that is not the case, how should the set method be implemented so as to make property gettable but not settable (by throwing an IllegalStateError?)?

And assuming that I

Using Fluther

or

Using Email

Separate multiple emails with commas.
We’ll only use these emails for this message.