Adobe Connect User Community
Menu

#1 2010-12-18 19:10:05

**_heidiwormser_**

SDK - detect when user has left meeting room

I'm working in Connect 7/Flash AS2.
I'm basically trying to duplicate the attendees pod by adding names to a list as users join the meeting and sorting them alphabetically. I think I have that working fine, however, I can't figure out how to detect when a user leaves the meeting.

I realize that the code I have that removes the user name from the list is probably not going to work, since I've sorted the list and I'm probably going to have to jump through some hoops to remove the correct name. But I've also tried to just write some text to a dynamic text box to indicate that a user has left and I'm not having any luck with that.

My code is below. I'm very new to Collaboration SDK. Any help would be greatly appreciated.

--------------------------

var m_syncConnector:BreezeSyncConnector;

syncConnector.addEventListener("caughtUp",this);
syncConnector.addEventListener("syncMessageReceived",this);
syncConnector.addEventListener("userLeft",this);

function caughtUp() {
    mname = syncConnector.userName;
    lname = syncConnector.userName;
    syncConnector.allowParticipantPublish("addUser",true);
    syncConnector.dispatchSyncMessage("addUser",mname,true);
    mcScore.list.addItem({label:mname}); //allows own user name to show in list for each instance
    //syncConnector.addEventListener("userLeft",this);
    syncConnector.allowParticipantPublish("userLeft",true);
    syncConnector.dispatchSyncMessage("userLeft",userLeft,true);
    mcScore.list.removeItem({label:lname});
    sortList();
}


function sortList() {
    mcScore.list.sortItemsBy("label",Array.CASEINSENSITIVE);
}

sortList();


//RECEIVE

function syncMessageReceived(p_evt) {
    if (p_evt.messageName == "addUser") {
        mcScore.list.addItem({label:p_evt.messageValue});
    }
    if (p_evt.messageName == "userLeft") {
        //mcScore.list.removeItem({label:p_evt.messageValue});
        leftName.text = "User has left: "+(p_evt.messageValue);
    }
    sortList();
}

Offline

#2 2011-01-19 11:05:34

**_palkan_**

Re: SDK - detect when user has left meeting room

first of all, delete this:

"
syncConnector.allowParticipantPublish("userLeft",true);
syncConnector.dispatchSyncMessage("userLeft",userLeft,true);
"

because message "userLeft" is predefined by the sync component. It triggers, when somebody left the room.

try this:


function userLeft(p_evt:Object){

   leftName.text+="user "+p_evt.userID.toString()+" left\n";

   
}


but there will be only the userID. If want to know, which user is left, you have to know pairs user-userID. Or every time send some message, kinda "who's there?", to get info about current users.

Offline

Board footer