Tuesday, October 02, 2007
Notes from Best Practices for Developing with AS3
- Set programming conventions up-front explicitly and code to them (casing, whitespace, etc.)
- Program to interfaces
- Memory and Performance Considerations
- Only load in or instaantiate what you need
- Remove listeners or object references when you're done with them
- Remove debug code - trace() statements - before production release
- global scope = bad
- mxmlc, make sure to set the optimize compiler option to true
- Evaluate array length and assign to a variable to be used in the loop condition
var len:Number = collection.length;
for(var i:Number = 0; i < len; i++)
{
// Loop
} - Use weak reference event listeners unless you know you don't want to
addEventListener(Event.CLICK, myHandler, false, 0, true);
(it is false by default)
Comments:
Post a Comment