PDA

View Full Version : Private Chat Problem


boybetrayed
06-21-2005, 05:23 AM
Hi gurus,
I am working on a private chat(One to One) just like a messenger.
I am using tutorial_text (sample) as base.

Is there any code available for the private chat. Please help gurus..

The Main.asc file is as show below... What should be in the client ?

application.onAppStart = function()
{
trace("Begin sharing text");

// Get the server shared object users_so
application.users_so = SharedObject.get("users_so", false);


// Initialize the history of the text share
application.history = "";


// Initialize the unique user ID
application.nextId = 0;
}
//application.onConnect = function(newClient, name)
application.onConnect = function(newClient, name)

{
// Make this new client's name the user's name
newClient.name = name;

// Create a unique ID for this user while incrementing the
// application.nextID.
newClient.id = "u" + application.nextId++;

// Update the users_so shared object with the user's name
application.users_so.setProperty(newClient.name, name);

// Accept the client's connection
application.acceptConnection(newClient);

// Call the client function setHistory, and pass
// the initial history
newClient.call("setHistory", null, application.history);

// The client will call this function to get the server
// to accept the message, add the user's name to it, and
// send it back out to all connected clients.
newClient.msgFromClient = function(msg) {
application.users_so.send("msgFromSrvr", msg);
}
}
application.onDisconnect = function(client)
{
trace("disconnect: " + client.name);
application.users_so.setProperty(client.name, null);
}

Brajeshwar
06-26-2005, 06:25 AM
We have used the old Samual Wan's code and improvise on it again and again and have build many facades of private chats. Try this one for instance

http://dev.oinam.com/avconf/
UID: lestrade
PPhrase: agile

boybetrayed
06-26-2005, 06:37 AM
Hi ,It seems to be good Audio and video Flash script, excellent work.
What i am looking for is a MSN messenger type(web based) one to one chat system where all the User name will be displayed like

Test 1
Test 2
Test 3

and so on...

so if for example i am logged in as CALLE

and click on Test1 a pop should open and start a private chat between Test 1 and CALLE

Also once clicked on Test 2 a separate conversation with Test 2
so 2 windows .... and so on ..

Also i should be able to change the color...for the messages...

Please Help and i know you would.

Brajeshwar
06-26-2005, 06:39 AM
Well, the way you like is also definitely possible.
But it is not something that I wrote some lines of coe and it will be working for you. Why not you start off and ask us for further help.

boybetrayed
06-26-2005, 06:44 AM
Well i had infact...but as a newbie dont know like what has to be putin on the client site.

If you check the post above thats the main.asc file that i have been using.

any idea on what has to be done on the client side/code to send and retrieve messages

sara.s
12-09-2007, 07:04 AM
Hi
I'm wondering if you find the answer, I need to build the private chat and I don't know how...:confused:

Brajeshwar
12-09-2007, 07:12 AM
Yes, we did. This is very old story.
We did it during the Flashcom 1.0 server days and many people have come up with many other solutions after that.

I don't even remember, where I kept that source archive.
If you're still interested, contact me (http://www.brajeshwar.com/contact/).