View Full Version : Why doesn't this work?
dudeman
September 1st, 2002, 11:12 PM
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 :\
lostinbeta
September 2nd, 2002, 01:09 AM
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.
Bezzer
September 2nd, 2002, 02:45 AM
for things like text color where ur using html wouldn't you have to use userText.htmlText = blah blah blah
? :)
lostinbeta
September 2nd, 2002, 12:37 PM
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".
dudeman
September 2nd, 2002, 09:03 PM
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?
dudeman
September 2nd, 2002, 09:05 PM
Gr just download the **** thing!
http://www.macromotive.com/ebay/dalu/loginchat.fla
heh fix the scrollbar while your at it :P
Bezzer
September 3rd, 2002, 01:24 AM
gees ppl are trying to help you and u get angry at them...:P
lostinbeta
September 3rd, 2002, 01:27 AM
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.
dudeman
September 3rd, 2002, 06:29 AM
=) heh but thanks to dan too, its on his space
lostinbeta
September 3rd, 2002, 11:49 AM
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:(
dudeman
September 3rd, 2002, 09:02 PM
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
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.