AS3 class to access external XML... help

So I have a class that reads from an external XML file, and it works great. (uses URLRequest and complete event listener)

I have functions in it to read certain parts of the file.

Im trying to create a new instance of that class in my document class. I am able to do this, BUT because the XML class loads the file, and uses a complete event listener to load it, anything I try to access (var or function) come up blank because it fires before the file is done being loaded.

Id like to be able to do something like this.

var prefs:XMLClass = new XMLClass();

var localcolor:uint = prefs.color; (access the public variable color)
var localcolor:uint = prefs.getColor();

If I access the var, it is 0 (unset), and if I call the function, it says “Cannot access a property or method of a null object reference” because it hasn’t loaded yet.

What am I doing wrong?