Wednesday, March 30, 2005
 
Implicit Getters/Setters & Interfaces

Implicit getters/setters are viewed as properties by Flash's built in compiler.
Even if you favour explicit over implicit there may still be circumstances where you want to use implicit getters/setters (for example, when making your own versions of common components that retain full interchangeability with Macromedia's). However, the built in compiler* does not allow properties to be defined in Interfaces.

The solution is to use addProperty()- remember it? It's the original way of creating implicit getters/setters in AS1. Just to recap: It allows you to define methods ( e.g. "getWidth()" & "setWidth()" ) yet set and access them as if you are dealing with a single property ( e.g. width=20 or trace(width) )

(*note: MTASC allows both methods and properties to be specified in Interfaces)




Thursday, March 24, 2005
 
If you ever get a compiler error similar to this... "The class 'ucles.util.Invalidator' cannot be imported because its leaf name is already being resolved to imported class"... check that you're not already importing the contents of the entire directory (ie "import ucles.util.*"). I spent a good few minutes wondering what a leaf name was, and then a few more wondering why SE|PY's search function wasn't turning up anything untoward for the search term 'Invalidator'!

Oh, and I stumbled across this Flash FAQ earlier today. I get emailed about many of these issues frequently, so this link should save me some typing ;)
Thanks Senocular.




ARCHIVES

  AS Hero   blog feed

nwebb.co.uk - flash tutorials, php and more.