PDA

View Full Version : Key Combination Problem



Irontigerz
December 27th, 2007, 10:58 AM
onClipEvent (load)
{
movement = 5
var fight = false;

}
onClipEvent (enterFrame)
{
if (fight == false)
{
if (Key.isDown(39))
{
setProperty("", _x, _x + 5);
setProperty("", _xscale, 40);
} // end if
if (Key.isDown(37))
{
setProperty("", _x, _x - 5);
setProperty("", _xscale, -40);
} // end if
if (Key.isDown(38))
{
this._y = this._y - movement;
} // end if
if (Key.isDown(40))
{
this._y = this._y + movement;
} // end if
} // end if
if (Key.isDown(88))
{
gotoAndStop(2);
fight = true;
}
else
{
fight = false;
} // end else if

var comb = keyDet.addCombination(39, 90, 88);
onKeyCombination = gotoAndStop(3);
fight = true;
}

I want to make the flash file have a three button combination press, so that when it gets pressed it goes to kick frame, but the problem i have is when i export the move it's automatically kicking without me press the three buttons, please could anyone help me to fix the problem.

p.s i am using the key detection action script as seen on http://www.kirupa.com/developer/actionscript/multiple_key_detection.htm (http://www.kirupa.com/forum/../developer/actionscript/multiple_key_detection.htm)
and thanks in advance:hugegrin:

leonthelion
December 27th, 2007, 03:32 PM
If you have an mc, did you make sure you have stop() on his first frame, that might be it :D (hopefully).
EDIT:
I can't read code easy 0_o so im not much help really. Good luck

Irontigerz
December 27th, 2007, 04:57 PM
no that didn't fix it but thank you anyways, i uploaded the file to sendspace http://www.sendspace.com/file/esc5xt
if u want to have a mess around with it to get it working.

leonthelion
December 28th, 2007, 12:09 AM
I can't help you with the code :( maybe someone else can, but im not good with long/advanced codes (or anything with an as file). Good luck again ^^