-
Two buttons pressed
I'm having trouble with an on Press action, what I'm trying to work out is to click on two buttons in a specific order to activate a script.
sw1 and sw2 is the buttons instance names.
if ((press) == sw1 &&(press) == sw2){
}
-
.
Hi,
Does it need to be in order or maybe just both together ish?
Attach your *.fla, lets look
-
.
Hi,
This might help you along, make a new AS2 document, paste this and test it.
PHP Code:
var keyListener:Object = new Object(); keyListener.onKeyDown = function() { if (Key.isDown(Key.UP) && Key.isDown(Key.DOWN)) { trace("Bingo"); } }; Key.addListener(keyListener);
-
Thank you for your help but by buttons I mean the picture ones on the stage that have instance names, not the keyboard. Sorry about not explaining it better before.
on (press) {
}
The stage buttons to be both hit in order to activate script.
-
.
Hi,
well attach your *.fla so I dont need to make my own file
-
.
Hi,
Here is roughly put together effort, 3 buttons on stage, named btn1, btn2, btn3, code placed on timeline, not on the buttons
PHP Code:
var code:String = "";
btn1.onPress = function() { code += "1"; test(); };
btn2.onPress = function() { code += "2"; test(); };
btn3.onPress = function() { code += "3"; test(); };
function test() { trace(code); if (code == "123") { trace("Bingo"); code = ""; } if (code.length > 3) { code = ""; } }
-
Wow thanks so much! I appreciate it!
I was about to post my file after cutting down the size but this works just the way I needed it to, thank you so much!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|