I'm recieving a "Error #1009:Cannot acces a property or
method of a null object reference" when attempting to run
expandItem on a Tree object. I have a Tree class via mxml that is
using XMLList as a data provider:

Upon looking at the variables of the Tree object, I notice
that the iterator was null. Now, the iterator doesn't seem to be a
class variable as it is not declared in the Tree class (maybe
declared in the one of the subclasses?), so I am not sure when this
variable is to contain a value.

OK... I just found the answer... and in hopes of keeping
someone like me from banging their heads on the wall for fours here
is the answer.

It appears that the iterator variable will have a value with
the creation of the Tree is complete. So, I just called the
expandItem method after the Tree is completed, and everything
works. Here's the changed code: