Disabling Buttons
Hello, I have a very simple flash movie with three buttons each loading a different SWF, my question is how to diable the button that has loaded its swf so that you cant keep reloading it, and then how to activate the button again when you click one of the other buttons.
here is the code I have now, the SWf are very simple motion tweens. I hope this helps and thanks in advance.
stop();
loadMovie("scene1.swf", 1);
butn1_btn.onRelease = function() { loadMovie("scene1.swf", 1); }; butn2_btn.onRelease = function() { loadMovie("scene2.swf", 1); }; butn3_btn.onRelease = function() { loadMovie("Scene3.swf", 1); };
FlashKit > Flash Help > Flash ActionScript
Posted on: 12-14-2005, 05:43 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Targetting 'Hit' State On Buttons/immediately Disabling Buttons
Hi,
I have a button which, when clicked on, is set to disable itself. However, when it's clicked, the mouse is obviously still over the button and so the 'Over' state is shown - which implies that the button is still active. I don't want this - I want the button to be completely disabled as soon as it is clicked. If I move the mouse away from the button then it becomes completely disabled.
See here:
http://www.russellgillman.co.uk/testmenu.swf
When you hover over the buttons the text becomes yellow. When I click on a button, the green block moves to the selected button and the button is disabled, and yet the text remains yellow. I want it to become white immediately.
Code on the button:
Code:
on (release) {
services_btn.enabled = false;
getURL("www.site.com", "mainFrame");
slider.xMove = services_btn._x;
about_btn.enabled = true;
rates_btn.enabled = true;
rental_btn.enabled = true;
sales_btn.enabled = true;
coverage_btn.enabled = true;
contact_btn.enabled = true;
}
What I'd like to do is to target a specific frame in the button - eg:
services_btn.gotoAndStop("Hit");
but this doesn't work.
Can some help please!? Thanks...
Disabling Buttons
I have created a menu system where each button sets off a colour tween similar to the one used on digitalorganism.com
At the moment when one button has been pressed and the colour tween sets off (approx 3 secs) the other buttons can still be pressed. How do I disable them until the tween is finished?
Also, how do I prevent the button that is currently pressed from working i.e it can't be pressed if the info attatched to the button is currently been shown?
Any help would be much appreciated.
Thanks,
Shaka
Disabling Buttons?
Is there any way to disable buttons on a movie?
My situation is this :
I'm loading a movie on top of another and the new movie overlaps the other seperated by a 90% opaque white box... (so it's semi see-through and looks nice and everything) and from the movie on top, regardless of the fact that there is a shape on top of some of the buttons essentially covering them up, you can still click on the buttons that are covered, ie bringing up the hand cursor and it's very annoying. Is there anyway around that?
Disabling Buttons
Hi,
Is it possible to put a transparent layer over several buttons in order to disable their rollover graphics? I have already tried to change them from buttons to graphics, but their 4 states play as the timeline moves so that doesn't work.
Is there any other way to achieve this?
Thanks
Disabling Buttons...Is This Possible
I have a bunch of popup windows in my site i was just wondering is there a way to disable every button on all the layers below the popup until the popup is closed with the close button i created?
any help would be appreciated.
Thanks
Elite311
Disabling Buttons
Not sure if there is an easy solution to this, but surely someone has encountered this previously ?..
I have some buttons on my main timeline within my "main.swf" file. I then load various swf's into the main.swf, both in levels and into mc's that sit on my main timeline.
However, the buttons that sit on my main timeline within main.swf can still be activated, even though another swf has loaded over the top and is covering the button, i.e. the button is penetrating through.
How can I stop this ?
I tried setting up a test swf whereby I loaded graphics and mc's over the top etc, but without joy ....
Surely I am missing something basic.
Thanks for any help,
motorpilot
Disabling Buttons
Hi
How do I go about disabling a 'next' and 'previous' button when I'm at the last and first images of a slideshow I'm creating? i.e. how do I disable a button?
Thanks for any help.
PS I'm using Flash MX
Ta
Disabling Buttons
in my navigation, when content overlays the buttons, how can i keep the mouseover from occuring? you end up seeing the mousover action play while they are behind the transleucent content background.
thanks!
Disabling Buttons
im redoing my portfolio b/c i dont like the current version. anyway i have a music options button and when its pressed, the music options box comes up where u can choose tracks or turn off all sounds. my problem is i want it so when this comes up, all the buttons in the bg are disabled. so like when this is up, the profile button wont be clickable. i first tried taking a screenshot, and having a layer with that play on top of buttons but under music options and then put blank keyframes in the button layers. but, this increases filesize a lot and i'd hafta take an new screenshot everytime i updated. so...is there a way i can mke it so all the buttons arent clickable for a certain amount of time (while the music options box is open)?
and i also added keyframes to the button layers during music part and deleted the actiosn for the buttons, but it still has that onMouseOver thing where the pointer turns to that hand thing, which gives the impression that the buttons are pressable. that might be even more confusing for the viewer so i decided not to use it
Disabling Buttons.....help
Hi guys
I am tryin to disable 4 buttons. The thing is that all the buttons, when clicked, activate the same movie(a popUp) so I want to have them disabled while the popUP is active, and then active again when the movie is closed.
I am tryin to avoid the long way of writing code in every button.
btw...i am using MX. any help would b appreciated
-
Disabling Buttons...
When you go to shutdown in Windows XP, you are prompted with a dialog box giving you 3 options either to "standby", "turn off", or "restart" your computer.
When this dialog box appears, all other buttons on your desktop (or whatever program you have running) are disabled. Is this effect of disabling certain buttons able to be duplicated in flash?
Thanks for your help.
Disabling Buttons
How do I disable a button (or a mc with a button in it) once the action has been performed?
For example: Info button is clicked, info slides into view, then you want the info button disabled so people can't keep playing that same movie again and again, before visiting somewhere else.
Thanks.
Disabling Buttons
I have searched through the boards about disabling buttons but cannot get it to work. I have tried both button_name.enabled=false; and button_name.useHandCursor=false I thought I read somewhere that this only works in MX. Is this true? If so, is there anything that can be done in 5?
Disabling Buttons...
I have a menu of mc that behave like buttons. I'm trying to do a check when they press it to see if the section they're selecting is already the section they're in so it won't reload the current movie.
I've tried using a global location variable but it's not working.
Here's what I've got.
Code:
// home.swf is loaded on level 99
// also, _global.location = "home";
// ex. of button actions
onClipEvent(load){
this.onRelease = function(){
if(_parent.location != "home"){
_parent.location = "home";
loadMovie("home.swf", 99);
}
};
}
It works fine w/ the if statement but it will reload the current movie if they click it again.
Anyone???
Disabling Buttons
I am trying to disable buttons in seperate movie clips as they overlay each other at times on my timeline. I have found the following:
http://www.flashkit.com/tutorials/Ac...-767/index.php
Which uses this AS:
on (release) {
featproj.enabled = false;
}
This works and disables the button "featproj" in that movie clip but when i duplicate it and target the other buttons in seperate MC's it does not seem to work. My other button has the instance "featsapote" and is within an MC "FeatureMC". Can someone please help me with my code Is this wrong?
on (release) {
featproj.enabled = false;
}
on (release) {
FeatureMC.featsapote.enabled = false;
}
Disabling Buttons?
Hello all.
I an creating a web page with one main page and the various other pages are created using the loadMovie comand.
I have six buttons along the bottom and each button loads a different movie into an empty movie on the main page and unloads the unwanted one.
I have everthing working so far but I want to disable each button when its movie is already loaded, when it is already playing in the main window so it won't jump back to the start!
I have uploaded the main .fla and the .swf for the home button to see if you can help me out.
Any help would be greatly appreciated.
thanks
Craig
Disabling Buttons
I'm wondering is there is a generic script that will disable any button instance below or on a certain _level of a movie. Or do I actually have to address each button instance that exists in that level if the timeline.
If I use a generic naming convention such as: "btn1", "btn2""btn3"...and so on - would it be possible to create a function that will address a range of instance names; i.e.
Maybe by defining the instance names with:
btnX
where X=1 through 100
Then use:
_level0.ContainerMC.btnX.enabled=false;
I realize the above is not correct; maybe someone could lend some guidance?
Thanks
Disabling Buttons
hey guys,
i don't want users to be able to click my buttons while a section is loading...
is there a function i can use to disable mouse clicks once a button is clicked and a section of my site is loading?
Disabling Buttons
I have a page that I am creating that has several menu buttons. When the user clicks on one of the buttons, I have a movie clip slide on to the screen and covers the buttons. However, the buttons are still active beneath the clip. Is there a way to set up the layers properly so that a clip on top prevents the buttons underneath from being active?
thanks
Disabling Buttons?
lo there again, I was just wondering how one could make it so that once a button has been depressed it is inactive until another button is pressed,so that when a button loads an external movie, it won't load it again should the button be pressed again by accident.
I'm lost on this one, but the wig is doing good.
Disabling Buttons
G'Day, folks I am trying to make each button disable it's self when clicked and reenable when another is clicked. Heres the code
Quote:
var disabledButton = null;
function switchDisabledButton(){
if (disabledButton != null){
disabledButton.enabled = true;
disabledButton._alpha = 100;
}
disabledButton = this;
this.enabled = false;
this._alpha = 50;
}
for (var x in this){
if (this.[x] insanceof Button) {
this.[x] onRelease = switchDisabledButton;
}
}
}
Every time flash pops an error saying it's missing a ")"
can anyone help please?
Disabling Buttons.
I am finishing up a site for my friend and I want the buttons on the main menu to disable when they are pressed. Right now once you press a button it just leaves it enabled so it can reload the movie, and I don't want that of course.
The site is Kristen Wright Photography
Can anyone help me with this.I have no idea how I got this far and can't figure this little problem out.
Disabling Buttons
Hello everyone,
I have a movie/game that has a bunch of buttons and what not...When I click one of the buttons a movie clip is made visible (giving the effect of a pop-up window), however the buttons in the background are still clickable...
Question: Is there actionscript I can use to disable the buttons (not make them invisible but just disabled) and if not Actionscript any method?
Thanks for your time and reading,
Disabling Buttons
I have an .swf file being loaded into a container movieclip using loadmovie. I need to disable all the buttons on the main stage and stay disabled until i close the external .swf with unloadMovie. How do I get this done? Please help. Thanks!
Disabling Buttons?
Quick question. I have 4 buttons that I need to disable. I have this code in frame 1:
Code:
//add button instance names to array;
var aAnswerButtons:Array = new Array("btn01","btn02","btn03","btn04");
trace(aAnswerButtons);
Later on I am using this code to disable the buttons:
Code:
for (var i:Number = 0; i<aAnswerButtons.length; i++) {
//disable ANSWER buttons;
aAnswerButtons[i].enabled = false;
}
However the buttons are still enabled. Once disabled, the buttons should still be visible but the user should not be able to click or use a keypress to select them.
Any suggestions?
Disabling Buttons In One Swf From Another
Hi, this problem has been annoying me for a good few hours now and I'm fresh out of ideas. Basically I am trying to disable a button in one flash file from another. Here is my flash movie setup:
There are 3 swf files
a 'container' that does all the loading
the main file that the user will interact with
another file that has a bit of animation which loads on top of the main one
The main flash file has a button which when clicked on loads up the flash file containing the animation on top using loadMovie(). However, even though this new movie is loaded on top, the button in the movie behind it is still clickable - something i want to avoid.
I have tried using button_name.enable = false via a on (release) event on the button that loads the animated movie but that stops the animation from working for some reason.
I have also tried unloading/hiding the main movie using various methods. this was quite successful but caused 'flickering' when the animated movie was unloaded and the main one was loaded back in.
I have attached my 3 fla files because my explanation was probably rubbish
I'm a bit of an actionscript noob, so i hope my code doesnt scare the people that do take the time to look at it
Thanks in advance
Disabling Buttons
I have btn2 on layer1 which goestoAndPlays frame2 in MC2 (which is on layer2).
When MC2 is played, it overlaps btn2 (which's on layer1). But clicking on the area where the button is, behind MC2, on layer1, it still plays MC2 from start.
Now, i want to disable it. Is there any coding that I put on the 2nd frame of MC2 which Disables btn2 (which is outside MC2) and the last frame of MC2 which Enables it back again before MC2 ends.
Disabling Buttons
So I've been creating this menu that loads an animation through the loadMovieNum() command when one of the buttons in the menu is pressed. However, I'd like to disable the menu while that animation is running.
I first tried loading a false menu over the real menu (I put a new menu that had the buttons changed into graphics on layer 90) but the buttons underneath still reacted. I even tried putting a solid object (Just a solid rectangle to make sure I was really over the menu) over the menu, and while the buttons then couldn't be seen, they still reacted to the mouse rolling over them.
Is there a simple way to disable the buttons while the animation loads and then re-enable them once it's finished?
Disabling Buttons
Hi i am making a flash mp3 player and was wondering if there was away to disable a button if a certain event happens. I want my volume to go up to 100 and then disable the button from making the sound go any loader.
Disabling Buttons
Hello everyone,
I have my buttons on the left part of my flash page.Id like to disable the button that loaded the mc kinda:Home button disabled when home mc is loaded.I tried the tutorial on www.gotoandlearn.com but it didn't work on every button.I thought maybe i would have to use some script like if else,but i am not that expert to know above this point.
My buttons are animated mcs and i am using only external mcs not long timelimes on the main scene.
Can anyone give some light?
Thanks a lot.
Christian
Again Disabling Buttons
good day members of Kirupa
i am not good in action script but i will tell you my idea
i have 6 buttons each button inside a movie clip which have animation onRollover
and onRollout.
now my question is
when i press the button, the button animation start from frame 2 inside the movie clip
and stop for instance frame 8
then it will be disable until i press another button
so the previouse button will be enabled and it will continue the animation
basically i put the code in the time line on the stage here it is
Code:
for (i=1; i<6; i++) {
this["mc"+i].onRollOver = overMe;
this["mc"+i].onRollOut = outMe;
this["mc"+i].onPress = selectMe;
}
function overMe() {
this.gotoAndPlay(2);
}
function outMe() {
this.gotoAndPlay(8);
}
function selectMe() {
this["mc"+i].enabled=true;
}
i tried my best to solve it ,,, but no way
any help guys to fininsh it
file is attached
note :
i am using flash professional 8
-Disabling Buttons?-
Ok, so I've got 11 buttons in a portfolio section on the main timeline and each one of them loads a separate external .swf into an emptymovieclip ... is there an easier way to disable the buttons when a movieclip is being loaded into the emptymovieclip rather than just stating:
button1.enabled = false;
and then:
button1.enabled = true;
for each one? and then re-enabling them after the external movie has been loaded...??
Any help would be greatly appreciated!
Disabling Other Nav Buttons
hi, hopefully someone can help me out with this one.
everything works in this script except that i'd like to be able to disable every other button than the currently selected one. i'm attaching movieClips from the library and then setting an action for each onRelease with a value in the aNavAction array.
any guidance would be great.
thanks!
ActionScript Code:
#include "lmc_tween.as"var aNavAction:Array = ["section1", "section2", "section3"];for (var i:Number = 0; i<aNavAction.length; i++){ curr_item = attachMovie("button", "button"+i+"_mc", i, {_x:i*101}); curr_item.section = aNavAction[i]; curr_item.onRollOver = function() { this.colorTo(0x6699cc, 1, "Linear"); }; curr_item.onRollOut = function() { this.colorTo(0xCDE0EA, 1, "Linear"); }; curr_item.onRelease = function() { trace(this.section+".swf"); };}
Disabling Buttons
Hello to all who have seen this topic over and over..
and thank you in advance for the answers~
So here it goes...
I have a photogallery with buttons correlating to each gallery.
When a button is clicked, the ever-so-popular xml-photogallery is launched into an empty movie clip.
A common problem here is that when there is a new MC launched, the buttons on the main timeline are still active. Which is a big NO-NO.
So I've looked here and there for a solution to disable the buttons on the main timeline... And there are plenty of them, but I can't figure out where to place the AS. (in the maintimeline, in the button, in the new launched MC etc etc..... )
I'm not a genius with FLASH and the least bit knowledgeable wtih AS..
Could I make an if/else statement in the maintimeline??
Say, IF the empty movieclip (lets call it gallery) is occupied, disable ALL buttons on the maintimeline, ELSE, enable all the buttons on the timeline.
Is this plausible? If so, could someone provide me with the appropriate script. If not, do you have any other suggestions that would get rid of this problem all together, rather than putting code on each button/MC (which I wouldn't know anyways.... )
Thanks again, my genius'
Disabling Buttons?
http://www.kirupa.com/developer/mx20..._slideshow.htm
Can anyone help me how I could disable previous button in the first image and the next button in the last image??
Disabling Buttons?
Ok so I have a website, and each section fades in and fades out. The problem is the hidden sections (alpha=0) still have their buttons active...you can click them
and I don't use buttons, they are movieclips with actionscript in frame 1...
How would you make sure these are disabled?
What I tried was to create a variable sectionFlag:Number=1;
this would have a different number 1,2,3,4 depending on the current section
and then if (sectionFlag==4){ execute code }
however, the sob just wouldn't work, it would execute the code anyway!
Disabling Buttons
Hi,
Is there any actionscript that will disable/able all buttons and to accompany this any actionscript that will disable/able specific buttons?
Thanks
J_Mo
Disabling Buttons
So I've been creating this menu that loads an animation through the loadMovieNum() command when one of the buttons in the menu is pressed. However, I'd like to disable the menu while that animation is running.
I first tried loading a false menu over the real menu (I put a new menu that had the buttons changed into graphics on layer 90) but the buttons underneath still reacted. I even tried putting a solid object (Just a solid rectangle to make sure I was really over the menu) over the menu, and while the buttons then couldn't be seen, they still reacted to the mouse rolling over them.
Is there a simple way to disable the buttons while the animation loads and then re-enable them once it's finished?
Disabling Buttons Behind A Pop-up
I have a pop-up with an image inside my flashmovie, but I would like the buttons and text fields behind the pop-up to be disabled, so that I don't see a handcursor or textselector when I scroll over them.
Is there anyway to place some sort of code in my pop-up movie clip that tells the levels below it to disable all the buttons?
Or maybe a way to put a disabling symbol on top of the other levels?
Thanks
Disabling Buttons
Hello. I'm basically using this tutorial/fla file but was wondering if I could get some help on how I would go about disabling a button once it is pressed, while still controlling the movie clip content.
http://www.actionscripts.org/tutoria...em/index.shtml
I'm fairly new at actionscripting, so any help is greatly appreciated. Thanks in advance!!
Disabling Buttons
Hi,
with the following
ActionScript Code:
_root.mybutton.enabled = false;
disable my buttons so that the cursor does not change when the mouse is over them or should it totally disable the buttons, cursor and all?
Is currently seems to only disable my actions and not any cursor actions..
any ideas?
Disabling/enabling Buttons
I am attempting to create a learning system in Flash. The general idea of my project is that the user will be presented with a question and a list of options. Only one option is correct and the user must, ultimately choose the correct answer before he/she moves on to the next question(scene). Now I would like to create a forward navigation button that is disabled when the user first enters the scene, but enabled once they choose the correct answer. The catch is that this enabled button must take the user to the next scene in Flash once clicked.
In my research I have read that in order for a button to successfully execute the "go to next scene" function (via the gotoAndStop or gotoAndPlay) the button must reside on the _root in order to navigate to the next scene (i.e. it can't reside in a movie clip).
Any suggestions? I thought maybe using an Array would work, but I am very new to ActionScripting and have next to no experience with Arrays.
Thanks in advance for any help!
Disabling Buttons When Under Layers?
im making a menu system that when either of two buttons are checked, more options are revealed.
the check boxes remove a partly transparent layer above the buttons to reveal them. the buttons under it though can still be clicked under the layer.
Disabling A Movie And Its Buttons...
Hi There,
I have a movieclip with multiple movies in it, also multiple labels that the user gets sent to...
In the one movie it has some buttons that need to be disabled when its on a particular label...
Is there a way of doing this?
Help!
Disabling Buttons Flash 5
I have a movie clip with 20 buttons. This movie clip scrolls in a loop, forward and backwards - on a horizontal axis.
I need to make it so when I press one of the buttons that is becomes diabled and keeps a graphic visible of the down button state.
Then when I click on another button I want the button that was previously disabled in the down state to pop back up and the newly pressed button to remain down.
Any ideas?
Disabling Buttons On Under Layers?
I have a menu for a CD that has a number of buttons on level "0". When I load another swf into level "1" the buttons are not visible because I have a graphic to hide them, but they remain active. Is there any simple way to remove the functionality of the buttons on level "0" without using unload movie? Thanks.
Disabling Buttons Behind Layer
i have "white" mc which is completely white, with 50% alpha - on top of everything except alert window
how can i disable every existing button behind "white" mc so alert window works nice
please help!
Disabling/Enabling Buttons?
Hi, I have 8 buttons. Each in their own MC. Each button is assigned to load their own external .swf in. But what I would like to do is. Once a user clicks a button to disable it. And let them no longer use it til they choose a different button in the nav. Then once they do it I want it to enable the button, then disable the button they just clicked, etc. etc. I'd appreciate some help. Thanks!
|