|
-
the cheesy child
PHP mix up problem
Ok seriously, I feel that this is purposely trying not to work.
i got a chatroom.
username is the variable for user's username.
chat is the variable of where you type the message.
sender is a button.
board is the variable of where all the messages go.
I send messages typed in chat to PHP, write it to a txt file and then flash loads the txt file and copies it onto board as long as its not the same as last message...
here's my code... somebody modify it so that it will not let messages continuously send and also will send messages:
board = "";
//meshi is the start message for when you login
meshi = "Welcome,"+username+"! This is CheesySpace, where you can chat all you like in the cheesiest way ever!";
sound = new Sound();
sound.attachSound("message");
oldchat = "";
mesload = new LoadVars();
sendmes = new LoadVars();
sendmes.chat = meshi;
sendmes.send("write.php", "_blank", "GET");
sender.onPress = function(){
sendmessageya();
}
function sendmessageya(){
if(chat!==""&&chat!==" "){
sendmes.chat = username+" says:"+chat;
sendmes.send("write.php", "_blank", "GET");
}
chatmes.text = "";
}
onEnterFrame = function(){
mesload.load("message.txt");
mesload.onLoad = function(success){
if(success){
if(mesload.chat!==oldchat){
sound.start();
board = board+"\r"+mesload.chat;
oldchat = mesload.chat;
scrollmes.scroll = scrollmes.maxscroll;
}
}
}
}
stop();
oldchat = "";
chat = "Hello!";
ALSO!!! If you can help me, somebody help me make it so I can say when somebody signs out...
thank you all
julian
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|