Any reason why a username isn't appearing in chat_txt area?

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

DaveyJJ
Posts: 6
Joined: 13 Dec 2007, 18:11

Any reason why a username isn't appearing in chat_txt area?

Postby DaveyJJ » 17 Dec 2007, 14:22

Newbie question.

I modified one of the base examples slightly to reposition elements and now your user name isn't appearing before the chat text that gets posted in the chat_txt area. Your text appears fine, just not your name.

I have not screwed around with any of the code in frame 16, so I can't figure out why this part of the code (?) seems to be failing ...

Code: Select all

smartfox.onPublicMessage = function(msg:String, user:User)
{
   chat_txt.htmlText += "<b>[ " + user.getName() + " ]:</b> " + msg
   main_sb.setScrollPosition(chat_txt.maxscroll)
}


I think it's this part that's not showing up ...

<b>[ " + user.getName() + " ]:</b>

Any thoughts? Is there a value I need to change to set the max width of the chat_txt area?

Thanks.
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 17 Dec 2007, 17:25

What if you remove the <b> tags?
Maybe it's just a matter of fonts embedding?
Paolo Bax
The SmartFoxServer Team
DaveyJJ
Posts: 6
Joined: 13 Dec 2007, 18:11

Postby DaveyJJ » 19 Dec 2007, 13:16

Thanks Paolo. I'll give that a try and see if it helps this morning and post a reply in case it's helpful for others.

Yup, removing the bold did it. If I use this line ...

chat_txt.htmlText += user.getName() +": " + msg

it appears perfectly. The minute I try to add a bold to the name, it's no good anymore. Very odd.

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 30 guests