MovieClip(parent).addEventListener isn't allowed?

I am trying to add an event listener to a parent object from a child object, is this not possible???


MovieClip(parent).smartFox.addEventListener(SFSEvent.onConnection,onConnection);

That works fine when placed on the parent object…


smartFox.addEventListener(SFSEvent.onConnection,onConnection);

Not sure what to do here… I even tried the uza.utils* global class.

maybe parent isn’t valid yet? Whats the error

The standard null object refrence.

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at battleTanksGame$iinit()
at battleTanks/::onJoinRoom()

I got around it now anyway… The reason my global wasn’t working becaust it was placed before the initialization of the client.

        smartFox=new SmartFoxClient(true);
        global.smartFox = smartFox;

This works…
global.smartFox.addEventListener(SFSEvent.onUserVariablesUpdate, onUserVariablesUpdate);