quote:
Originally posted by #BG
Javascript code:
function OnEvent_ChatWndEditKeyDown(pChatWnd, nKeyCode, bCtrl, bShift)
{
// Declare a variable to hold the value of the 2 virtual key
var VK_2 = 0x32;
// Check if the key pressed are Shift and 2
if (nKeyCode == VK_2 && bShift == true)
{
// Validate that we can type
if (pChatWnd.EditChangeAllowed == true)
{
// Gain access to the contact object
var oContact = new Enumerator(pChatWnd.Contacts).item();
// Validate that the contact is not blocked and that they are on the MSN network
if (oContact.Blocked == false && oContact.Network == NETWORK_MSN)
{
ChatWnd.EditText = ""; // Now how should I use it? }
}
}
}
You declared the function pChatWnd so as such any references need to be pChatWnd not ChatWnd as I have highlighted in your code.