im using key.addlisteners to check for key presses. but if a person presses all 3 keys at once (RIGHT, LEFT, UP) then releases one at a time, only the first release is noted by flash. see a demo at:
http://www.starvingeyes.com/temp/listener.swf
is there any way to solve this?
NOTE: I do not want to use if(Key.isDown…etc) to get this to work. if you are interested in why see below.
here is the code:
[color=Red]
myListener = new Object();
myListener.onKeyDown = function() {
if (Key.getCode()==39) {
rb=true;
}
if (Key.getCode()==38) {
ub=true;
}
if (Key.getCode()==37) {
lb=true;
}
if (Key.getCode()==32) {
sb=true;
}
}
myListener.onKeyUp = function() {
code= Key.getCode()
if (code==39) {
rb=false;
}
if (code==38) {
ub=false;
}
if (code==37) {
lb=false;
}
if (code==32) {
sb=false;
}
}
Key.addListener(myListener);[/color]
i want to publish my movie with WMODE set to transparent windowless. there is a glitch in flash that makes it so if(key.isDown(key.right)) sort of codes dont work in anything but IE when WMODE is set this way. therefore i am looking for any alternative to this. let me know if you have any others.