ActionScript 2.0 :: Check Many Different Variables In Many Different MC's Without A Billion If/else Statements?
Sep 17, 2005Is it possible to check many different variables in many different MC's without a billion if/else statements?
View 2 RepliesIs it possible to check many different variables in many different MC's without a billion if/else statements?
View 2 RepliesI have more than one Event Listener that calls a specific function, and I want to add if statements to check what event is being passed. How can I do that?I tried a simple comparison like:
if(evt == MouseEvent.MOUSE_OVER)
But it will give an error because I comparing a MouseEvent object and a String.
I'm using the SQLRunner class made by Paul Robertson and I need a way to determine when an executeModify batch has finished executing so I can safely move on to the next step and work with the data.
the function can be called with a resultHandler and progressHandler function when it's called, but I am getting a complete event with every query in the batch. I put `if (completedCount == totalCount)` in my progress handler, but it never gets called.
Most of the info is covered in these classes in the sqlrunner package..
[URL]
I am trying to check 3 scores at once. Is there a better way to code this... I want to check to see if they are all tied? If one score is greater than another? Seems like there should be a more cleaner way.
[Code]....
this function is use to generate characters, is there anyway to generate character by passing in a parameter instead of check with if statements?
function charcheck() {
for (i=2; i<9; i++) {
com = new c1();
[Code]....
used to be able to handle variables and if else statements back in AS2.0, but I don't know how to go around them in AS3.0For instance, a code like this:
stop();
var pageNum = 1;
var pageAnim = 1;
[code]....
I'm working with 2 global variables and I need to compare them on 6 different button function clicks for a lot of different scenarios.[code]My function is starting to look like this;[code]only problem i see is that there are many different scenarios and this if statement could get very long. Is there a way to combine it somehow so there wouldn't be that many else if's?
View 3 RepliesI'm having the hardest time getting this to work, I have the concept of how things need to be put together, but the code is wrong. I can't even get the first if statement to work.I have a menu that is going to be loading external swfs into an empty mc. It needs to check to make sure the external swf has gone through its stopping animation before loading something else. Here's what I've got so far... I hope this is clear enough...button:
Code:
on (press) {
//check if this is the first mc being loaded
[code]....
How can I randomly create some variables as the movie loads so I'll be able to use this variables as a if statement later on and make the movie play diferent labels?
View 4 RepliesI have 2 loadVars - myVars, myPictures
basically i have defined their onLoad functions
so in myVars, i call for
Code:
myPictures.load("http://www.fakedevil.com/lurgee/pictures2.php?id="+this._parent.link2.text+"&time=" add getTimer(), "");
pictures2.php is working cos I just check so by rite the variables loaded should change.. but somehow each time I check those variables in myPictures.onLoad, the variables are always the same.
I made this music video, and now I'm trying to give is some UI controls. I have a play and replay button at the start and the end. But I want to have a pause/play button available to users all the time. I know how to do that for one object at a time, but I have around 80 layers. How do I make it so it will pause the whole video (including the music) without a billion lines of code?
View 9 RepliesI just want to know if there is a way to assign multiple variables, and if there is a way to check multiple variables.
I want to be able to assign variables to false and then check if all the variables are false.
We have a FLASH website that uses PHP to authenticate users.
We have recently been asked to implement TWO variables as we used to only have one.[code]...
I wanted to check the value of 5 different variables at the same time.
Based on the value each of variable I wanted to make 5 corresponding movie clips do something.
There has gotta be a better way to do this rather than me using a bunch of if else statements.
I have a form that uses PHP to check to see if all variables are filled in. I have a button with
on (release) {
formcheck();
}
that checks the formcheck function and then sends the form or gives a popup that tells what part of the form needs to be filled in.
My problem is that I have a movie that I'd loike to act as a button. I've done this before with any other command (gotoAndPlay, getURL, etc), but the
on (release) {
formcheck();
}
does not work with a mc button, only with a regular button. Does anyone know a way around this, or why it does not work?
First of all sorry im not very familiar with the flash lingo, im still new to all this actionscript stuff
ok so i wrote this on a frame in the timeline[code]...
now i need to check which one from all these has a value of zero. then when it finds it i need it to tell me which one it is (s1x or s2x or s3x) so i can do stuff with it.
it's not working. why not?
[Code]....
I use Flex SDK in command line to develop a flash.But trace() doesn't work with Flex SDK.Is there another good way to check values of variables?
View 2 Repliestrying to make a yahtzee game but cant get it to score the 3 and 4 of a kind. I have dynamic text boxes that convert the dice to a number for scoring called result1, result2, ... How do I test to see if 3 of them match or 4 for the 4 of a kind and add the text boxes if 3 numbers match. I have a button that will start the function called score_3kind.
View 9 RepliesAny best way to script several MCs (acting as buttons) so that on release(), the alphas on the others tween to 20. When you go to click one of the dimmed button, its alpha should tween back to 100 and the previous one that had the full alpha should now fade to 20. Logically, I know I need to somehow implement a variable to check the state of the MC and an if statement to script the actual alpha tweens but I'm confused as how to actually implement it. Where to put it etc.
View 14 RepliesI am trying to build a AS3 only project in Flex....I have tried debug mode, but seems like it takes so long to compile....I can't use trace or check variables...Are there anyway to do debug??
View 1 RepliesIf they get a question wrong in my quiz ( weakest link) the money clip goes to zero and it goes onto the next question. If they get it right the money clip advances and they go onto the next question. I want to include each time that it should only go onto the next question if all questions have been asked. SO i want an extra if clause in both sections, saying if current question is more than 11 go to '#game over"The questions are saved in the frame of the quiz
_root.qArray = new Array("question: A;B;C;D")
_root.qArray.push("Question?:A;B; C; D")
There are 11 questions.At the moment at the section with choosing answers I have
function selectAnswer(n) {
// correct
if (answers[n] == correctAnswer) {
_root.money.nextFrame();
[code].....
I define this function
function beatsFilledcheck():void
{
if (a1Shape == "none" || a2Shape == "none"[code].....
whenever I run as
beatsFilledcheck();
it sets beatsFilled = true even if all but one a*Shape variables are still "none".cant understand why?
See [URL] Now there is a button called Answera, which when clicked should have a symbol (movie clip) called Check appear at the cordinated specified. Check exists in the libary (but does not have an instance name) and no where else on the stage. when I run this code I get: 1180: Call to a possibly undefined method Check. -> var rightCheck = new Check(); How is it undefinded if it exists in the libary?
View 7 RepliesThe following is my codes. This is still work in progress; so, you will see some functions with empty contents. Plus, this is my first Flex application; please bear with me. This is a quiz application that gets the questions and answers to each questions from a ColdFusion web service. There are three types of questions, True or False, Multiple Choice with single selection, and Multiple Choice with multiple selections. So, based upon the question type, the application would dynamically generate the appropriate amount of radio buttons or check boxes for the users to select. I got these working. The problem that I am having is, I am not sure how to check what the users have actually selected. In some other forums and posts on other web site, it said that I can use event.currentTarget.selectedValue to get the user selection. But when I actually do it, I got a run-time error saying, "Property selectedValue not found on mx.controls.FormItem and there is no default value." My question is, what do I need to do to capture the user selections?
[Code]...
I am trying to use if and else statements and failing. I am either completely missing their purpose, or just not writing the correct code. Scenario: I have designed a gallery that consists of animation in movie clips that are placed on the time line. With the if/else statements I need Flash to know what movie clip the user is on, so that the users next action loads the correct movie clip.
[Code]...
Is it possible to double up If Else statements? [code]...
View 2 Replieshow do i create an if statement for some buttons to say something like:
-if button1 is pressed go to frame1
-if button2 is pressed go to frame2 etc.
i know i could use button1.onRelease = function(){blah blah;} but i would like to start using if statements and this is a good place to start i guess
I want to join two if statements together and I'm unsure of the syntax. This is what I have but it is obviously wrong. if (Key.isDown(Key.RIGHT) or if (moveRight_btn.onPress){
View 7 RepliesHow to do a rollover button where you rollout and it doesn't another option depending on the current frame. So I decided to open up another actionscript file and do a test so that I knew that I could make an if statement work in a barebone state. And I can't get it to work
First I stated my variable to be 0. I added 3 buttons. Button One makes the variable unit "myVar" to 1 and Button Two makes it 2. And my output button reacts to these variable changes. But it doesn't work.
ActionScript Code:
One_btn.addEventListener(MouseEvent.CLICK, OneV);
Two_btn.addEventListener(MouseEvent.CLICK, TwoV);
Output_btn.addEventListener(MouseEvent.CLICK, OutputV);
var myVar:Number = 0;
function OneV (event:MouseEvent):void {
[Code] .....