Hi all,
I currently have a chatbox (named chatBox_mc). Is there any way I can use the server to display a message inside the chat box?
I tried messageQueue (chatBox_mc.messageQueue += "message" ) but I'm not sure how to do it correctly.
Thanks!
Way to inject text from server in chatbox?
Hi bax, thanks for your help.
I looked into sending moderator message and found the following page:
http://docs2x.smartfoxserver.com/api-do ... quest.html
which does it for Actionscript. Looking back to my original post, I was pretty uninformative, so let me clarify!
In my game, at the end of each player's turn, the server does several actions which I'd like to have a text footprint (e.g. "Character A was moved to position X, Y!") displayed in the chatbox.
I'm looking at sendModeratorMessage (from here) but have a hard time finding an example of how to use it, as this is my first time programming something significant. Can anyone please give me something to work with?
Thanks again for your help!
I looked into sending moderator message and found the following page:
http://docs2x.smartfoxserver.com/api-do ... quest.html
which does it for Actionscript. Looking back to my original post, I was pretty uninformative, so let me clarify!
In my game, at the end of each player's turn, the server does several actions which I'd like to have a text footprint (e.g. "Character A was moved to position X, Y!") displayed in the chatbox.
I'm looking at sendModeratorMessage (from here) but have a hard time finding an example of how to use it, as this is my first time programming something significant. Can anyone please give me something to work with?
Thanks again for your help!
Bax, thanks for your help, but I'm still stumped.
I know I've correctly referenced sfs2x.jar and sfs2x-core.jar because I've been sending regular messages to my clients successfully, but my moderator messages still aren't working. Is there another library that I need to be referencing? (I can't find it.. )
I know I've correctly referenced sfs2x.jar and sfs2x-core.jar because I've been sending regular messages to my clients successfully, but my moderator messages still aren't working. Is there another library that I need to be referencing? (I can't find it.. )
Not sure what you are doing wrong. Inside the main extension code, or inside a request handler code, if I write:
everything is fine (if entering valid arguments of course).
Code: Select all
getApi().sendModeratorMessage(arg0, arg1, arg2, arg3)
everything is fine (if entering valid arguments of course).
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Hi bax,
With your help, I've solved it! The big problem was i wasn't using getApi() in the beginning.
Thanks a lot for your help!
I actually have another question though: Is there a way to remove the white space between each moderator message? In the chatbox properties, I've set the Moderator message header text as "Game: ", but 2 lines of white space (<br>s?) keep appearing as such:
"
Game: Ranger moves to 4,4
Game: Ranger moves to 3,4
"
How can I remove these white spaces that appear before and after each moderator message?
With your help, I've solved it! The big problem was i wasn't using getApi() in the beginning.
Thanks a lot for your help!
I actually have another question though: Is there a way to remove the white space between each moderator message? In the chatbox properties, I've set the Moderator message header text as "Game: ", but 2 lines of white space (<br>s?) keep appearing as such:
"
Game: Ranger moves to 4,4
Game: Ranger moves to 3,4
"
How can I remove these white spaces that appear before and after each moderator message?
Return to “SmartFoxBits for SFS 2X”
Who is online
Users browsing this forum: No registered users and 15 guests