Code: Select all
on (release, keyPress "<Enter>")
{
if (!_global.isBusy)
{
sendChatMsg();
} // end if
}
But its not working any help?
Code: Select all
on (release, keyPress "<Enter>")
{
if (!_global.isBusy)
{
sendChatMsg();
} // end if
}
Rutter wrote:Key.addListener(keyListener);
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(Key.ENTER)) {
sendChatMsg();
}
};
Rutter wrote:dont use on(release) Thats only used for a button or movieClip.
The keylistener object watches for an event of a key being pressed. If the enter key is pressed the sendChatMsg() function is fired. Enter the code exactly as I showed you. Cut and paste.
Code: Select all
_root.onEnterFrame = function() {
if (Key.isDown(Key.ENTER)) {
_root.sendChatMsg();
}
}
Return to “SmartFoxServer 1.x Discussions and Help”
Users browsing this forum: No registered users and 40 guests