| dieversochi |
17.04.2009 01:20 |
Помогите забиндить клавиатуру к кнопкам
Ситуация такого характера. Есть скрипт 3 кнопки настроены на мышку хочу к ним добавить кнопки на клавиатуре. С АС не знаком. Будьте любездны и подробны!
Код AS1/AS2:
function onMouseDown()
{
if (btn_bet.hitTest(_root._xmouse, _root._ymouse, true))
{
if (!btn_bet.enabled)
{
return;
} // end if
this._onPress(btn_bet);
} // end if
if (btn_start.hitTest(_root._xmouse, _root._ymouse, true))
{
if (!btn_start.enabled)
{
return;
} // end if
this._onPress(btn_start);
} // end if
if (btn_double.hitTest(_root._xmouse, _root._ymouse, true))
{
if (!btn_double.enabled)
{
return;
} // end if
this._onPress(btn_double);
} // end if
} // End of the function
function onMouseUp()
{
if (btn_bet.hitTest(_root._xmouse, _root._ymouse, true))
{
if (!btn_bet.enabled)
{
return;
} // end if
this._onReleaseBet();
} // end if
if (btn_start.hitTest(_root._xmouse, _root._ymouse, true))
{
if (!btn_start.enabled)
{
return;
} // end if
this._onReleaseStart();
} // end if
if (btn_double.hitTest(_root._xmouse, _root._ymouse, true))
{
if (!btn_double.enabled)
{
return;
} // end if
this._onReleaseDouble(btn_double);
} // end if
} // End of the function
|