hi all, can somebody help me with my codes in my flash game . Because here in my game the main character is controlled through mouse and i want it to be controlled in left and right arrow keys. Here are the codes:
on the character itself:
onClipEvent (load)
{
Hedding = false;
left = this._width / 2;
right = _root.end._x - _root.end._width / 2 - this._width / 2 + 50;
time = 0;
original_width = this._width;
}
onClipEvent (enterFrame)
{
if (time <= 0)
{
this._width = original_width;
} // end if
–time;
if (Hedding == false)
{
x = _root._xmouse;
left = 50 + this._width / 2;
right = _root.end._x - _root.end._width / 2 - this._width / 2;
if (x < left)
{
x = left;
}
else if (right < x)
{
x = right;
} // end else if
this._x = x;
} // end if
if (Hedding == false)
{
this.gotoAndStop(“stand”);
} // end if
}
in another movieclip i have placed 2 keyframes containing these codes:
KEYFRAME 1:
if (_root._xmouse > _level0.circle._x)
{
_level0.circle._x = _level0.circle._x + 10;
if (_root.sammy.Hedding == false)
{
_root.sammy.gotoAndStop(“right”);
} // end if
}
else
{
_level0.circle._x = _level0.circle._x - 10;
if (_root.sammy.Hedding == false)
{
_root.sammy.gotoAndStop(“left”);
} // end if
} // end else if
KEYFRAME2:
if (_root._xmouse > _level0.circle._x)
{
_level0.circle._x = _level0.circle._x + 10;
}
else
{
_level0.circle._x = _level0.circle._x - 10;
} // end else if
gotoAndPlay(1);
So, my question will be how can i change the code so that the control will be
on key left and right??? plsssssss help!!!