ActionScript 3.0 :: Creating An Array To Disable A Group Of Buttons
Jan 31, 2011
I have 6 main buttons and 50 other buttons. When people click on one of the six main buttons, I need the 50 other buttons labeled from t_1 to t_50 to be disabled (mouseEnabled=false).I should add that all 50 buttons are in a sub group:this.wholeTree.t_1
I don't want to write the same line of code 50 times so I'm trying something like this. This is the code for button#6:
butt6.addEventListener(MouseEvent.CLICK,menu6Handl er);
function menu6Handler(e:MouseEvent):void
{
if(this.menu6.currentFrame==15){
[Code]....
This returns 2 errors: The first one is warning 3596 Duplicate variable definition: I tried assigning the variable definition just once at the beginning of the function but then it no longer works and the buttons 1 to 50 don't get disabled. The second error is TypeError: Error #1010: A term is undefined and has no properties.at main_Sustainability_fla::MainTimeline/menu6Handler()
View 7 Replies
Similar Posts:
Jan 26, 2011
New at AS3, more of a designer than coder but I try. This will probably be easy for this forum's pros: I have 6 main buttons and 50 other buttons. When people click on one of the six main buttons, I need the 50 other buttons labeled from t_1 to t_50 to be disabled (mouseEnabled=false)
I don't want to write the same line of code 50 times so I'm trying something like this. This is the code for button#6:
butt6.addEventListener(MouseEvent.CLICK,menu6Handl er);
function menu6Handler(e:MouseEvent):void
{
//other tasks, etc...
[Code].....
View 4 Replies
Nov 10, 2006
i am working on small project where i find my self stopping at this rateMmm.. this project is dealing with buttons placed in MC name = main.ButtonCon the main i am programing those buttons as if
Code:
_root.main.ButtonC.b5.onRollOver = function() {
this.swapDepths(11);
[code]........
View 3 Replies
Jun 12, 2008
not sure how difficult this is going to be, but I have 30 movie clips, which will all be sequentially numbered. (pos1, pos2, pos3......pos30). They will all have the same functions, with the only change being the number. I know there is a more efficient way to write this code using arrays, but I will need help with it. I would rather have 10 lines of code than 150. I also need help with writing the code, that will disable all other movie clips, once the first one is clicked. Also, not sure how tricky the javascript part will be. Below is the code i am trying to achieve, but the long version.
[Code]...
View 1 Replies
Mar 30, 2010
im trying to disable a radio button group in flash, so users cant change the selected item.
im using the following code to create the radio button
var rbuttongroup:RadioButtonGroup=new RadioButtonGroup("radioGroup");
then adding radio buttons to it on the fly, my question is how do i go about disabling the radio buttons ?
EDIT - im using action script 3.0 !! and when i try doing
rbg.enabled = false;
i get an error 1119: Access of possibly undefined property enabled through a reference with static type fl.controls:RadioButtonGroup.
View 1 Replies
Feb 19, 2009
I have this to create radiobuttons. How can I now disable all radiobuttons in the same group when one is selected..?
Code:
var radioGroup:RadioButtonGroup=new RadioButtonGroup("group_"+i);
for (var r=0; r<10; r++) {
var tipsRb:RadioButton = new RadioButton();
tipsRb.value=r+1;
tipsRb.label=""
[Code] .....
View 4 Replies
Jun 4, 2009
I was wondering if its possible to add an array of filters to a movieclip, then remove the ones that correspond to another array.At the moment, I can add the filters to the array with concat but there doesn't seem to be anyway to reverse that.I think it's easy to show what I want to do with code:
Code:
var filterslist:Array = new Array();
var filters1:Array = new Array();
var filters2:Array = new Array();
[code].....
/* hover out: (what I want to to do but no function seems to exist): */
filterslist = filterslist.removegroup(filters3); // think of it as an inverse concat function
this.fitlers = filterslist;
I think it may be possible to do by looping out the filterslist array, sub-looping the filters3 array and then comparing each one and splicing it out if they match but this seems long-winded, bad code and would produce bad performance.
View 3 Replies
Nov 17, 2009
How do I set up an array (or other method), to disable the visibility of a group of movie clips all at once?
I've tried this...
var invisibleMCs:Array = new Array ("MC1", "MC2", "MC3");
invisibleMCs._visible = false;
View 1 Replies
Mar 24, 2012
How can I enable or disable a group of components in flex (flash builder 4)?
For example, if I have a window with several fields, I want to disable them based on the users permissions.
I know I can add the enabled="true" or "enabled="false", and I can also use enabled="{writeAccessVar}"
However, I am looking for more ideas, as I might have more than one group of fields on the screen, or more complicated user permissions.
For example, I will currently have one field with write access, the other fields on the screen read only for a certain user level.
For a higher level user, all fields are writable. Lower level, all are read-only.
View 1 Replies
Jan 15, 2010
I have a code:
import fl.controls.RadioButtonGroup;
rb1.label="C++";
rb2.label="ActionScript 3.0";
[Code]......
View 3 Replies
Apr 22, 2009
I have lots of buttons on the stage but they all do the same thing, ie. CLICK & DOUBLE_CLICK.How can I group these functions so that if a button in a certain group is clicked then the functions of buttons in all other groups are disabled?
View 2 Replies
Aug 14, 2009
when i press my button i then need to show a group of around 15 buttons so the code would be something like....
ActionScript Code:
function but1Click(eventObject:MouseEvent) {
button2.visible=true;
[code]....
View 3 Replies
Mar 11, 2011
how to tween the buttons separately.
View 1 Replies
Apr 9, 2009
I need to be able to click and drag multiple objects at the same time I can make it drag 2 objects but when I add another one it doesn't work?
View 2 Replies
Jul 6, 2009
In Flex, sometimes when you need to clear a form you run into the problem that radio button groups seem to defy clearing: try as you might, setting selected=false on all buttons, setting selection=null on the group, doing both, doing them twice, etc., you always seem to end up with one pesky little radio button that's still selected. How do you solve this and restore the radio button group to its initial no-selection state?
View 7 Replies
Aug 19, 2008
I have a movie with 5 movieclips named section1_mc, section2_mc, section3_mc, etcI want to advance to frames 1 - 5 by clicking in each of the movieclips. Do I need to add the onRelease to each of them, or is there a way to do it once for everybody. I tried the code below, but when I click on any of the movieclips the timeline goes to frame 5, the last one.
Code:
for (i = 1; i < 6; i++) {
_root["section" + i + "_mc"].onRelease = function(){
[code].....
View 3 Replies
May 11, 2011
I need to reset or deselect a group of radio buttons. How do I do that ?
View 2 Replies
Jul 14, 2005
i want to make a group of buttons, this buttons have to be in constant movement, random movement, so i download an example from this site, So now i have all the buttons moving, and the quesition is this... how can i make the random movement stop, on the rollover, and make it start again in the rollout.... thats the whole stuff..
View 6 Replies
May 22, 2009
I haven't been able to find the answer to this: I have a quiz-like animation that uses a group of radio buttons, I need the group to reset, clear or deselect the previous selection after submitting the answer on each question, is that possible?
[Code]....
View 8 Replies
Aug 14, 2009
I've got some MC's in my library that have radiobuttons in them -- all of this created at design time -- and pull them onto the stage dynamically. My question is how do I get the selectedData from the group? The setup is like this: In a MC called pageOne, I have a group of buttons with a group name of Q1, Q2, etc. I pull the MC onto the stage like this:
[Code]...
Do I need instance names on each of the buttons and add listeners to all of them?
View 4 Replies
Jun 9, 2009
Is there a way to use ActionScript to disable all buttons in a movie at the start of the movie (or at any given time in the movie), and then re-enable them at a certain time? I'm using Flash MX (only version I have access to), and I know how to get to the ActionScript panel and use it for basic things like stopping/playing a movie or jumping to a certain frame, but I haven't figured out much about ActionScript beyond that.
(btw, what version of ActionScript does Flash MX have?
View 10 Replies
Oct 4, 2006
I have an array called dropTarg1 which stores dropped-in items.I want to loop through this array and in a textfield, display each array item on a new line of this text fieldI think I need to use something like Array.join("/n") but I can't get it working properly. I hope that the /n would create a new line of the text field called reviewBoxContentText.
for(var i:Number = 0; i<dropTarg.length; i++){
with(reviewBoxContent.reviewBoxContentText){
autoSize = true;
[code].....
View 2 Replies
Nov 20, 2010
I have designed a website in Flash AS2 and it is nearly complete, but I have one big problem. On my main page, I have a line of scrolling buttons as well as a slide show which also doubles up as a button. All of these buttons link to FLV movies. When clicked, the movie page fades up to cover the entire stage.This is the effect I want and I like the way it looks, but the problem is, all the buttons remain active underneath the FLV as it plays.So if you accidentally click on the movie while its playing, it's still possible to trigger one of these buttons, causing all kinds of undesired chaos!Here is a link to the current swf, so you can see exactly what I'm talking about.
The row of scrolling buttons (the circles) and the arrow buttons at the bottom are contained within a single movie.I must point out that I am not well versed in action script. I have picked up bits and pieces as I've gone along but I don't speak the language
View 10 Replies
Nov 13, 2009
I want to disable the tooltip on certain buttons.
The tooltip manager seems to be an all or nothing solution. Is it possible to disable the tooltip for just one or two buttons?
View 1 Replies
Oct 5, 2011
During an upload I need to disable all buttons on stage except the one to cancel the upload process. I tried this but "mybutton" keeps on being disabled:
stage.mouseChildren = false;
mysection.mybutton.mouseChildren = true
View 1 Replies
Oct 1, 2010
I am creating a spinning globe where I set up two movieclip buttons. One is called "europe1" and another is called "russia1". When you roll over "europe1" button, movieclip "europe_people" starts to play and button "closeEurope" appears. When you click on "closeEurope" button, the movie clip "europe_people" and the button "closeEurope" disappears and the globe begins to spin again. If you roll over "russia1" the same thing happens.
What I want to do at this point is if the user rolled over "europe1", I want to deactivate button "russia1" on the spinning globe until the user closes "europe1" by pressing the "closeEurope" button. When the user presses the "closeEurope" I want "russia1" button on the spinning globe to activate again. [code]...
View 1 Replies
Nov 8, 2005
Movie should not RESTORE(MINIMISE) if ESC is pressedMovie should not Close if ALT + F4 is pressed How should i deactivate or Disable ESC and ALT buttons in flashi have used fscommand on frame enter i could deactivate all other buttonsbut
View 3 Replies
May 19, 2002
After A.swf loaded on the top of B.swf,How can I disable all buttons in B.swf?
View 4 Replies
Dec 11, 2007
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!
View 8 Replies
May 13, 2010
I have several layers of scrolling BGs via action script. In between these layers are a set of simple buttons made via "button" symbols. Within the stage, the buttons are recognized, however, when I test the movie, the buttons are not recognized/activated by the cursor. My guess is that the scrolling BGs that are on top of everything else (NOT added via "addChild" in a blank movie clip below all other layers) are somehow "blocking" my cursor from reading the simple buttons "below" them.
For the visual aspect of the project, the scrolling BGs are needed both "below" and "above" the buttons, so I need a work-around for simple button use in this multi-level scrolling BG environment. (just to clarify, by "above" and "below" I dont mean vertically above and below, but rather "layered" above and below, so as to "cover" eachother).
View 1 Replies