I have a movie (main.swf) and when you click one of the buttons, it loads section.swf on top of main.swf onto level 1
When section.swf appears on the screen, everything is fine BUT… the buttons on the main.swf work THROUGH the section.swf which is on level 1. Is there anyway to cancel out the buttons on level 0 when a movie is loaded ontop of it to level 1???
Hi,
Working in MX you can use mc’s instead of buttons and the mc button can be disabled.
Do you know how to do this ? It is very straightforward and gives you a lot more control/options than using flash buttons.
Hi,
I really didn’t know that ! That you could disable an actual button !
I have not used Flash buttons for a long time, preferring to make mc’s and enable them, and in F5 I used the good ol’ invisible button dropped in an mc.
Steve D: it’s is really a cool feature I learned from electrongeek. when u disable buttons the hand doesn’t even appear over the button when you roll over it. pretty cool no?
Hi,
Agree it is a very good feature, however, a couple of things to note, you must give the button an instance name and address it by its name ( it doesn’t seem to work with this.), also, once you have disabled a button, you have to renable it from somewhere else, either the timeline or another button.
yup exactly what i meant by the last post, otherwise your buttons will be disabled forever! I think “this” will work as long as all your buttons are in a movie clip, but don’t quote me cuz i’m not 100% sure. Senocular showed me how to disable all buttons one day, but he code was very complex, I think he used a prototype, and that’s when he used “this”. Disabling buttons had me so confused for such a long time, I used to make a movieclip and by using the with() I could take my mc to frames where there were no buttons, but all of that has changed thankfully.
hey, you could be right there, we haven’t had a peep from him/her (lol!!!)
btw - how I make buttons, I only ever make one button, unless the buttons need to “look” different - very rare, against what some people may call bad practice, my button code goes on the first frame of the button(mc), that is rollOver, rollOut, & release.
my on release code nearly always looks like this
[AS] this.onRelease = function(){
//either
gotoAndPlay(_name);
}
//which sends the playhead to a frame label
//that matches the name of the button
//or
_root.holder.loadMovie(_name + “.swf”,1);
}[/AS]
Then I either duplicate the buttons manually ( when only 2 or 3 are needed and for larger menus with submenus I use loadVars to bring in a text file to create the buttons, the trick being to plan your naming strategy before you start to code - I must admit, not every thing I do is as straightforward as that, but I try and make it so.
interesting, i prefer to give my buttons instance names, and control them from an external script, meaning i don’t apply actions to my buttons directly. kinda looks similar to your code:
[AS]
myButton.onRelease = function(){
loadMovieNum(“digitalosophyiscool.swf”, 1);
}
[/AS]
i dont like to apply actions to the actual button because of neatness with my AS. if all button actions are layed out on one frame its easier to fix glitches, errors, or even just to look at. it amazes me the different styles and approaches people use to code, as i’m sure each has its advantages and disadvantages.
button actions are layed out on one frame its easier to fix glitches, errors
couldn’t agree more, think the only difference is that my button actions are all laid out in frame 1 of the button, by doing that I only need to write the action once, especially rollOver and rollOut functions, the same actions then apply to every dupicate of that button - and I do try very hard to keep my code as neat as I can, as I too like to see code that is clear and concise and immediately understandable.
I too am often amazed by the number of different ways that people code, when I see the threads regarding "best practice "etc, I always feel like chipping in to say the best way to write code is the way that an individual feels most comfortable with.
, by doing that I only need to write the action once, especially rollOver and rollOut functions, the same actions then apply to every dupicate of that button