flash help!
- Started
- Last post
- 7 Responses
- steadyvibe
is it possible to have more that one keypress act as a navigation?
I want the right arrow to move ahead one frame as well as teh space bar. can that be done?
- unfittoprint0
something like:
myListener = new Object();
myListener.onKeyDown = function () {
if (Key.getCode() == Key.RIGHT || Key.getCode() == Key.SPACE) {
this.gotoandStop(_currentframe+1...
}
}
- steadyvibe0
well the code i have right now is:
on (keyPress "") {
gotoAndPlay("slide3.1");
}
and i just want to add another key so the spacebar will work as well but it says syntax error
- Epictive0
You can always put more then one on a button:
on (keyPress " ") {
action;
}
on (keyPress " ") {
same action;
}
- unfittoprint0
that's flash5 actionscript and it's deprecated. You should start using the new MX standard code.
Just write it on an action layer and you should be fine...
- unknown0
does the actionscript format change with ever new version or something? all i remember are telltargets. damn.
- Epictive0
Just thought that that would be easyier for him to understand rather then listeners. Sorry.
- unfittoprint0
It's cool man. I've also been 'cleaning' actionscript in some old files I had with the new stuff.
Actually it makes life easier, you can now have your code 'centralised' in only one place (the layer) instead of putting it in buttons, movieclips events, etc...