# Why doesn't this work?

**URL:** <https://forum.kirupa.com/t/why-doesnt-this-work/5127>\
**Category:** flash\
**Created:** [September 2, 2002, 3:12am UTC](https://forum.kirupa.com/t/why-doesnt-this-work/5127 "2002-09-02T03:12:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![dudeman](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@dudeman](https://forum.kirupa.com/u/dudeman)\
**Post date:** [September 2, 2002, 3:12am UTC](https://forum.kirupa.com/t/why-doesnt-this-work/5127/1 "2002-09-02T03:12:22Z")

</div>

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 :\

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 2, 2002, 5:09am UTC](https://forum.kirupa.com/t/why-doesnt-this-work/5127/2 "2002-09-02T05:09:09Z")

</div>

Did you try…

```php

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

```

?

Or what about…

```php

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 2, 2002, 6:45am UTC](https://forum.kirupa.com/t/why-doesnt-this-work/5127/3 "2002-09-02T06:45:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 2, 2002, 4:37pm UTC](https://forum.kirupa.com/t/why-doesnt-this-work/5127/4 "2002-09-02T16:37:15Z")

</div>

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

```php

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”.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 3, 2002, 1:03am UTC](https://forum.kirupa.com/t/why-doesnt-this-work/5127/5 "2002-09-03T01:03:41Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 3, 2002, 1:05am UTC](https://forum.kirupa.com/t/why-doesnt-this-work/5127/6 "2002-09-03T01:05:04Z")

</div>

Gr just download the \*\*\*\* thing!

[http://www.macromotive.com/ebay/dalu/loginchat.fla](http://www.macromotive.com/ebay/dalu/loginchat.fla)

heh fix the scrollbar while your at it 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 3, 2002, 5:24am UTC](https://forum.kirupa.com/t/why-doesnt-this-work/5127/7 "2002-09-03T05:24:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 3, 2002, 5:27am UTC](https://forum.kirupa.com/t/why-doesnt-this-work/5127/8 "2002-09-03T05:27:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 3, 2002, 10:29am UTC](https://forum.kirupa.com/t/why-doesnt-this-work/5127/9 "2002-09-03T10:29:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 3, 2002, 3:49pm UTC](https://forum.kirupa.com/t/why-doesnt-this-work/5127/10 "2002-09-03T15:49:57Z")

</div>

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:(

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 4, 2002, 1:02am UTC](https://forum.kirupa.com/t/why-doesnt-this-work/5127/11 "2002-09-04T01:02:45Z")

</div>

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
