|
|||
|
I would like to submit the following "bug":
Open the flash client (f.ex the demo client on www.123flashchat.com), login and enter a room. Now hold the enter key. You will see you get a flood message and your chat message only contains empty lines. When you hold the enter key too long, it can happen that you begin typing at the second line instead of the first one (in the textfield). The users of my chat have problems with this, maybe also because they use somewhat older computers. Kind regards, Maverick |
|
|||
|
I have just solved the problem with the following code:
(I have put it in buttons.as) Code:
function LTrim(str)
{
var whitespace = new String(" \t\n\r");
var s = new String(str);
if (whitespace.indexOf(s.charAt(0)) != -1) {
var j=0, i = s.length;
while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
j++;
s = s.substring(j, i);
}
return s;
}
function RTrim(str)
{
var whitespace = new String(" \t\n\r");
var s = new String(str);
if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
var i = s.length - 1;
while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
i--;
s = s.substring(0, i+1);
}
return s;
}
function Trim(str)
{
return LTrim(RTrim(str));
}
Code:
op_mc.messageInput.text = Trim(Trim(op_mc.messageInput.text)); Code:
if (op_mc.messageInput.text == "")
***{
******return;
***}
***if (!canTalk)
***{...
This is it and this added code works for me to solve the "bug". Good luck! Maverick |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|