Why doesn't this work?

If you downloaded my login chat flash, it would be more clear.

chat += “<br>”+Handle+"< font color="#FFFFFF">: "+input;

Chat is a dynamic tbox which reads from input text box after a user hits enter to submit. Handle is the name of another textbox they put in, their ‘username’.

Since ‘chat’`s text is a rendered as html it is supposed to read it… so what am I missing out :\

Did you try…


Handle+"<font color="#FFFFFF">:"+input+"</font>";

?

Or what about…


handle = username; //whatever you use for usernames
userText="<font color="#FFFFFF">:"+input+"</font>";
//sets layout of text by user.
//The field input refers to the textbox name.

chatBox = handle+userText; //write message
//chatBox is the main chat screen area.

These aren’t tested or anything. Just theory, since I have never made a chat program in Flash, so I don’t know for sure if they will work.

for things like text color where ur using html wouldn’t you have to use userText.htmlText = blah blah blah
? :slight_smile:

Ah yes, where was my head. If only I knew


handle = username; //whatever you use for usernames
userText="<font color="#FFFFFF">:"+input+"</font>";
//sets layout of text by user.
//The field "input" refers to the textbox name.

chatBox.htmlText = handle+userText; //write message
//chatBox is the main chat screen text area.

That is the updated version, with the htmlText enabled “chatBox”.

Scene=Scene 2, Layer=Layer 2, Frame=1: Line 12: ‘;’ expected
userText="<font color="#FFFFFF">:"+input+"</font>";

Here, I’ll post the whole thing before I added this…

on (keyPress “<Enter>”) {
if (input == “lol”) {
lol = new Sound();
lol.attachSound(“lol”);
lol.start();
}
if(keypress_false) {
chat += login+": “+input;
keypress_false = false;
} else {
chat += “<br>” + login+”: "+input;
}
scroller_hit++;
scroller_1.setScrollPosition(scroller_hit);
delete input;
}

Don’t mind the “lol” thing… it was just something to fill space

And does anyone know how to make a sound play on any given keypressed?

Gr just download the **** thing!

http://www.macromotive.com/ebay/dalu/loginchat.fla

heh fix the scrollbar while your at it :stuck_out_tongue:

gees ppl are trying to help you and u get angry at them…:stuck_out_tongue:

He’s not yelling, he just figured out that it would save time if he uploaded the file rather than just said what code he used.

=) heh but thanks to dan too, its on his space

After looking at the .fla I realized that if you want mulitple people to chat, you will need to combine this with some PHP/mySQL action, which I have no clue how to do.

I believe your data in the chat area should be loaded from an external .txt file and reloaded into the flash movie when the file is updated. Then to have multiple users at the same time, that requires the action of PHP/mySQL. Otherwise you will only be able to have one viewer at a time.

Sorry:(

No no I’m trying to make a fake ai chat…

If this is fixed, all I need help on is reading a word anywhere in a sentance the user has written… :x