ActionScript 2.0 :: Using A Switch Statement And Put All Movie Clips And Their Corresponding Checkboxes In Arrays
Sep 28, 2003
3 groups of checkboxes that control visibility. Each group of checkboxes would be controlled by a radio button. That is, when radio 1 is true, the corresponding groups of checkboxes is enabled and the user can click away, making the corresponding movie clips become visible or invisible. The other two groups of checkboxes would be disabled. Then, when radio 2 is true, IT'S group of checkboxes would become enabled, and the others disabled, etc. So I thought I would try using a switch statement and put all movie clips and their corresponding checkboxes in arrays
[Code]...
But obviously it doesn't work. This is my first time working with a switch statement in Flash. Am I missing something obvious or is it a matter of a quoation mark missing or what? I'm not totally sure what belongs in the case () itself.
View 3 Replies
Similar Posts:
Aug 31, 2010
how to use arrays. Specifically, I'm trying to use an array to control a set of movie clips ("box1" - "box8") contained within a parent movie clip ("boxes"). I've looked at the help pages and tried to apply what I learnt to my situation. Below is my code, but I'm not sure if I'm completely missing the mark. There seems to be a problem with how I'm trying to address the elements of the array in my if/else statement.
[Code].....
View 3 Replies
Nov 8, 2010
I'm trying to learn how to use arrays. Specifically, I'm trying to use an array to control a set of movie clips ("box1" - "box8") contained within a parent movie clip ("boxes").I've looked at the pages and tried to apply what I learnt to my situation. Below is my code, but I'm not sure if I'm completely missing the mark. There seems to be a problem with how I'm trying to address the elements of the array in my if/else statement.(I'm using AS2 in CS3.)
var mouseListener:Object = new Object();var scale:Number;var scaleBig:Number = 200;var scaleSmall:Number = 100;
var boxArray:Array = [boxes.box1, boxes.box2, boxes.box3, boxes.box4, boxes.box5,
[code].....
View 7 Replies
Nov 23, 2010
I have this code in my Flash file[code]...
I'm wondering, when I remove the movie clips should I also be popping them from the array?
I have an onEnterFrame function that attaches the movie clips and pushes them into the array, so I'm worried that if I don't pop them the array will continue to increase in size and slow down the movie. Is this the case, or will they be automatically removed from the array by the removeMovieClip() method above?
View 3 Replies
Jan 28, 2010
I am a Flash newbie and I've probably bitten off more than I can chew with this one...it sounded so easy!
Okay, so here's what I want to do: There are 5 people layered across the screen. When you rollover the person, they change color and come to the foreground (over the other pictures). On rollout, they go back to the background and change back in color. On click, they go to a new screen with just their picture and some information.
I first started setting this up and did each person as a button. Then I realized that in doing that, the button would not come to the foreground on rollover if it was below other buttons in the layers. So I put all of the buttons in movie clips and applied AS to the buttons (inside the movie clips, with the buttons on the main scene) and the AS2 looks like this:
[Code]...
View 15 Replies
Nov 28, 2009
i want to compare two arrays of Movie clips.i want 2 check whether both have same movie clips this is how i tried.its not working.
for( var checker:Object in cardStore){
trace("*************************");
if( cards[index-1]==cardStore[k]){
[Code]....
View 2 Replies
Aug 2, 2006
I have some buttons that create draggable movie clips in arrays. But when I click on one button, and then another, for some reason the previous movie clip dissapears.Try clicking on one button a few times, then clicking on another, then another...
View 2 Replies
Feb 13, 2005
is there any switch statement in actionscript? if there is, how does it look like?
View 3 Replies
Mar 11, 2010
I currently have a code of a switch statement for as1- as2.[code]This code is for a dynamic tet with the var 'hint' (No ' ' )But in as3 there is no var and I am having trouble converting it to AS3 coding, can someone show me the correct conversion of the code to make it work with AS3. I will make the instance name 'hint'.
View 7 Replies
Nov 5, 2009
I have the following in my script:[code]where eProp is an Array.Tracing the eProp[3], shows the correct number (1 or 2) but the statement always jumps to the default part!In other words: If eProp[3] is 1 or 2, the switch do nothing, jumps to default.[code]What is wrong? AS can't evaluate Arrays? Or I did something wrong?
View 3 Replies
May 11, 2010
I generally use if statement for conditions. I would like to know the advantages of switch statement over if statement.
View 1 Replies
Apr 18, 2009
I am having an issue and cant figure it out..i had this working once but for some reason its not now...here is the [code]...
the trace statements work but no external swf's work.
View 4 Replies
Feb 27, 2006
Can you use ranges in a switch statement
E.g.
case 1 to 5:
case 20 to 30:
or even
case 1 or 2:
View 1 Replies
Jul 24, 2006
how to cycle backwards through cases in a switch statement.
based on it relative position??
Code:
var state=0;
nextB.onRelease=function(){
switch(state)
[Code]......
View 2 Replies
Aug 17, 2010
Working on a game where I load the level details from a XML file. In the XML file I list of the names of characters that I want to show on the screen; i.e. Snoop, Kilerz, Matts, etc.In my FLA file I have MovieClips that are named Snoop, Kilerz, Matts, etc.Currently I do this in my Character function:[code]so I can eliminate the switch statement as I have about 15 characters. When I use the new this[charId] I get the following error (for charId = "Snoop":error: Error #1069: Property Snoop not found on Character and there is no default value.
View 4 Replies
Mar 1, 2011
Id like to use a switch statement to check if a given value falls between certain values and then based on different values and then perform differently in each situation. I'm hoping i just have a syntax understanding deficit. Here's what i'm trying ...that doesn't work.
Code:
public function landingCheck():void
{
[code].....
View 7 Replies
Dec 17, 2008
I'm trying to use the value from a combo box in a switch case statement but it isn't working
Code:
var switchValue:int = 0;
switchValue = int(cmbColour.selectedItem.data);
switch(switchValue) {[code]....
View 4 Replies
Feb 11, 2009
how can I check the content of an array with a switch statement?
Code:
var array :Array =[0,0];
switch (array) {
[code].....
View 1 Replies
Oct 10, 2009
does anyone know if declaring new variables within a switch statement (inside of case: break actually creates new variables inside those switch statements, or are the variable declarations moved to the top of the function when compiled?
i know that when declaring new variables inside a for or while loop, the compiler declares those variables at the beginning of the function. is it the same for if or switch statements?
View 3 Replies
Nov 15, 2009
This is really hard to explain. Probably because its late and I am now totally confused and lost. Check out this page [URL] I want A, B, C, D, E all drag-able. when D is dragged B should mirror D's position X and Y plus E should follow D's X position, This works, try it. The opposite, When B is dragged, D should mirror B, and E should follow B's X, NOT working
[Code]....
View 2 Replies
Apr 5, 2011
I'm afraid I know the answer but I wanted to check first.
I want to run a single function based on multiple values.
[Code].....
View 2 Replies
Feb 24, 2011
I am trying to create a Flash styled shopping cart to integrate into my website. When the "Add to Cart" button is clicked, i am displaying the corresponding text down the side of the stage. However I need a "Total Price" Dynamic text field to display the Total price of all items clicked!I am new to flash and it's proving very difficult to me, as the only way i could think of doing this is creating Boolean variables with all the items and if "add to cart" had been clicked Boolean = True... But how do I code the addition of prices? and cater for all the variations that are possible?
View 15 Replies
Mar 5, 2010
I have a students xml from a database. The student_state column can have a value of "passed", among other values (hence the need for switch statement). When the list_changeHandler function is called, depending on the value of student_state, I want a form to display different fields. So I tried to dynamically create the form in actionscript, but it fails to show up when I run the flex application:
import mx.containers.Form;
import mx.containers.FormItem;
import mx.containers.HBox;[code].....
View 3 Replies
Jan 16, 2009
I'm trying to use switch/case staement instead of if/else but it's not working. Here's the code.
ActionScript Code:
//working code
function checkTarget(drag){[code].............
View 3 Replies
Jul 19, 2010
I've got a little script that scales a video to the stage. The scaleing function has a switch statement to indicate what kind of scaling to apply.
If I declare the case value of the switch statement internally all is fine. However if I load this value from an XML doc, even though the trace indicated the value has loaded, the switch never fires.
ActionScript Code:
/stage variables
var sH:Number;
var sW:Number;
[Code].....
View 3 Replies
Jan 24, 2012
Is it possible to have switch statement work with hasOwnProperty :
[Code]....
View 4 Replies
Feb 18, 2004
How do you do a range using switch statement in ActionScriptFor example:
score = txtScore.text
switch(score)
{
[code].....
View 3 Replies
Jul 13, 2008
Is there an efficient way to assign the following switch statement to two different buttons (movie clips)?
[Code]...
View 3 Replies
Oct 12, 2009
First time working with numeric comparison,[code]But, the code is not functioning. I don't want to use if .. else construct.
View 11 Replies
Feb 18, 2004
How do you do a range using switch statement in ActionScript For example:
[Code]...
View 3 Replies