Multiple Buttons Confusion

Help!!! I’m getting frustrated with buttons.\r\rThis is my first ever post.\r\rHow do I explain this? I’ll try to explain this algorithmically.\r\rIf button1:“on(Release)” {\r disable “on(RollOver)” & “on(RollOut)”;\r do action1;\r tellTarget (mc1) {gotoAndPlay(frame label 1);}\r }\rIf button1:“on(Release)” again {\r do action2;\r enable “on(RollOver)” & “on(RollOut)”;\r tellTarget (mc1) {gotoAndPlay(frame label 2);}\r }\rIf button1:“on(Release)” once more { \r do action1 again;\r disable “on(RollOver0” & “on(RollOut)” again;\r tellTarget (mc1) {gotoAndPlay(frame label 1);}\r }\r\rNOW, this is the more confusing part.\r \rI have six buttons doing the same thing as button1. But the confusing thing is: assuming the user did the same pattern of actions as the ones above, there would be no problem. But if the user clicks the button2, button1 has to automatically do Action2 and enable the other on(mouseEvent). It would even be more difficult if button3…button6 is clicked. How would the clicked button know what button did their Action1?\r\rI was thinking of using arrays or flags.\r\rThis is a little bit of what I had done so far.\r\r\ron (release) {\r if ( flag0 == 0 ) {\r flag0 = 1;\r tellTarget ("_root.bullet0") {\r gotoAndPlay (“toLeft”);\r }\r tellTarget ("_root.green") {\r gotoAndStop (“pickedResume”);\r }\r } \r else if ( flag0 == 2 ) {\r flag0 = 1;\r tellTarget ("_root.bullet0") {\r gotoAndPlay (“toLeft”);\r }\r tellTarget ("_root.green") {\r gotoAndPlay (“toResume”);\r }\r } \r else {\r tellTarget ("_root.bullet0") {\r gotoAndPlay (“back”);\r }\r tellTarget ("_root.green") {\r gotoAndPlay (“fromResume”);\r }\r flag0 = 2; \r }\r //reset flags\r flag1 = 0;\r flag2 = 0;\r flag3 = 0;\r flag4 = 0;\r flag5 = 0;\r}\r\ron (rollOver) {\r if ( flag0 == 0 ) {\r tellTarget ("_root.green") {\r gotoAndPlay (“toResume”);\r }\r }\r}\r\ron (rollOut) {\r if ( flag0 == 0 ) {\r tellTarget ("_root.green") {\r gotoAndPlay (“fromResume”);\r }\r }\r}\r\rBless you whoever has a solution to my problem.\r\r

What exactly is your problem ??\rpom 0]

I guess my problem is:\r1. How to disable on(RollOver) and on(RollOut) of a button\r2. At the same time, how do I change on(Release) algorithm if button is clicked again

Don’t use buttons, use movieclips with different frames for each release, and hit test in combination with on mouse event for the clicks, and maintain your flag in _root for all “buttons” to access/change it…if you’d explain a bit further as to what you need, i could try to come up with s’thing…

Or you could use markers : on (release) {\rif (marker == 1) {\r// bla bla\r }\rmarker = 0 ;\r}\rpom 0]

Actually, while waiting for solutions I was able to solve the activation and deactivation of the on(RollOut) and on(RollOver) events.\r\rSame as ilya…'s advice, I used markers. This is what I did…\r\rOn my “action” layer, frame 1:\r\r//initialization of flag for each button\rfor (i = 0; i < 6; i++) {\r&nbsp &nbsp &nbsp &nbsp set(“flag” add i, 0);\r&nbsp &nbsp &nbsp &nbsp set(“j” add i, 0); //flag for on(RollOut) event\r}\r\rActions for my button:\r\ron (release) {\r\r&nbsp &nbsp &nbsp &nbsp if (flag0 == 0) {\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp flag0 = 1;\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp tellTarget ("_root.bullet0") {\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp gotoAndPlay (“toLeft”);\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp }\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp tellTarget ("_root.green") {\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp gotoAndPlay (“to0”);\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp }\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp changeColor (color0, 0xFFFFFF);\r&nbsp &nbsp &nbsp &nbsp } \r&nbsp &nbsp &nbsp &nbsp else if (flag0 == 1) {\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp flag0 = 0;\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp tellTarget ("_root.bullet0") {\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp gotoAndPlay (“back”);\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp }\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp out(0);\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp changeColor (color0, 0x999999);\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp j0 = 1;\r&nbsp &nbsp &nbsp &nbsp }\r}\r\ron (rollOut) {\r&nbsp &nbsp &nbsp &nbsp if (flag0 == 0 && j0 == 0) {\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp out(0);\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp changeColor (color0, 0x999999);\r&nbsp &nbsp &nbsp &nbsp } \r&nbsp &nbsp &nbsp &nbsp else {\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp j0 = 0;\r&nbsp &nbsp &nbsp &nbsp }\r}\r\ron (rollOver) {\r&nbsp &nbsp &nbsp &nbsp if (flag0 == 0) {\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp over(0);\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp changeColor (color0, 0xFFFFFF);\r&nbsp &nbsp &nbsp &nbsp }\r}\r\rNow, my problem is the interactivity of SIX buttons. \r\rIf, for example, I press BUTTON1, and ACTION1a is done. When I press BUTTON2, I would like ACTION1b to be done along with ACTION2a. I could achieve that.\r\rBut the thing is, I have a BUTTON3 to BUTTON6. How would the button I just clicked to know whose ACTION was done. Is it ACTION1a, ACTION2a?\r\rI still haven’t come up with an algorithm for that. Do you know of any solution for this problem? \r\rThanks for your time.\r

Well, if you don’t have the algorithm, I don’t see how you can solve this, except if you write the cases one by one.\rpom 0]