In Actionscript 2 I find that I cannot have a “private function set” without returning the error “A member attribute was used incorrectly.” If I change it to “public function set” I’m fine but that defeats the goal of trying to protect the function from setting externally.
Anyone have a simple fix/alternative?
It’s a known bug:
https://bugs.adobe.com/jira/browse/ASC-3601
You can’t mix a public getting with a private setter. Since you’re only accessing it from that class, just make the variable private and set its value without using a setter. The main reason to have a setter anyway would be to expose the ability to change its value from outside of your class, via the public declaration (there’s probably other reasons, but that’s the main one), so if you only want to change it internally, then just change the value (I know, then it’s not consistent and in 1 place – but yeah, ya know…)