I’ve come to a stumbling point.
How do you have flash recognize a double pressed key from a single press?
Similar to a double click on a window program opening the software, and a single click selecting the program. How would you program flash to do a similar detection?
For instance, if I have a MC named “hero” and I want it to move casually with these simple movement scripts:
_root.hero.onEnterFrame = function() {
if (Key.isDown(87)){
movement = "up";
this._y -= _root.speed;
}
if (Key.isDown(83)){
movement = "down";
this._y += _root.speed;
}
if (Key.isDown(65)){
movement = "left";
this._x -= _root.speed;
}
if (Key.isDown(68)){
movement = "right";
this._x += _root.speed;
}
}
However, if the “up” (87) is double pressed I want it to move double times the speed for a short second.
Is there any suggestions for this function?