This content has been marked as final. Show 2 replies
Is there a myMcBox2Tween function for the btn_openMcBox2 button? If so, why not disable the btn_Exit1 button here
btn_openMcBox2.onRelease = function():Void
mc_box1.btn_Exit1.enabled = false;
Then enable the btn_Exit1 button after the exit tween for the mc_box2 has completed.
myMcBox2Tween.onMotionFinished = function():Void
mc_box1.btn_Exit1.enabled = true;
That way you don't need to do all that Boolean testing.
Hope that helps
Thanks for your response and suggestion Noelbaland. While your suggestion offers a good solution, I would have to write so much more code if I don't use variables given the amount of movieclips that I'm working with. In my original thread I only included sample code, but in reality, I'm using 10 or so menus (mcBox1-10) on the left side of the stage, each with its own exit button that must be disabled when overlapped by any of the additional 10 or so menus (mcBox11-20) on the right side of the stage. Keep in mind that if I place an instance of any of the mc's (1-10) on the left of the stage and an instance of any of the mc's (11-20) on the right on the stage, the exit button for any of the mc's on the left of the stage will need to be disabled, so to give you a scenario of how much code I'd have to write without using variables:
- mcBox11-20 overlap any of the mcBox1-10 when they're on the stage, so...
- if mcBox11 is open, my code for the button that opens mcBox11 will have to disable the exit buttons for mcBox1- 10 depending on which one is open, so...
- if mcBox11 is open -> disable btn_Ext1, disable btn_Ext2, disable btn_Ext3, ..., disable btn_Ext10
- if mcBox12 is open -> disable btn_Ext1, disable btn_Ext2, disable btn_Ext4, ..., disable btn_Ext10
- if mcBox13 is open -> disable btn_Ext1, disable btn_Ext2, disable btn_Ext4, ..., disable btn_Ext10
- and so on...; I'd have to write just as much code to enable these buttons as well.
If I use variables, I'm creating only two functions (1 to enable and 1 to disable) the exit buttons, no matter which movieclips are placed on stage, and I run these functions on the buttons that open mc's 1-10 and mc's 11-20 (main timeline) and on the buttons that close mc's 11-20 (mc's 11-20 timelines); the code is much shorter this way, except that it's not working as I want it to right now :).
Sorry for the long email, but I think it's necessary to give you the entire picture.
Thanks again for your suggestion, and let me know if this makes more sense and if you can offer another suggestion.