Presence woes

set the presence up on Login using the following method

private function setupPresence() : void


connection.addEventListener(PresenceEvent.PRESENCE, onPresence);
presence = new Presence(null, connection.jid, Presence.SUBSCRIBE_TYPE, Presence.SHOW_CHAT, null, 3);


the PresenceEvent.PRESENCE fires but in the onPresence function the presence

var presObject:Presence = as Presence;

comes back as null every time.

Can anyone please help. Why is presence null?



around the page 6:

o  subscribe -- The sender wishes to subscribe to the recipient's presence.

Pass null when you are setting your own global presence.