ActionScript 3 Understanding the "Error 1009: Cannot access a property or method of a null object reference" Multi-tiered expression


Example

x=anObject.aProperty.anotherProperty.getSomething().data;

Here, any object before the dot can end up being null, and using methods that return complex objects only increases the complication to debug the null error. Worst case if the method is prone to extraneous failures, say retrieving data over the network.