Over 16,531,230 people are on fubar.
What are you waiting for?

Okay, you have made a movie clip, and you want it to change. Problem is, you have more than one change to make depending on the results of a user action or what-have-you... What do you do? Simple. You take the variable and put it into one of two types of condition statements: If or Switch-Case. The syntax is different for the If than it is for the Switch, but they do the same thing. They take the variable and give you different results depending on its value. "If" conditions are like Boolean variables. The result is based on True or False, or in the case of the Boolean variable, 1 or 0. "Switch" conditions give you three or more possible results. The SWITCH takes the variable and tells the rest of the statement to make a decision based on it. CASE is where the variable is tested for value, and it gives you a result based on one of many possibilities. if(variable1>=3){ gotoAndStop(2); } The above tells the file to go to frame 2 and stop there if the variable is at least a value of 3. You can add an ELSE statement after it, but I only suggest it if you don't want to mess with the SWITCH. switch(variable1){ case variable1>=3&&variable1<6: gotoAndStop(2); case variable1>=6&&variable1<9: gotoAndStop(3); } if(variable1>=3&&variable1<6){ gotoAndStop(2); }else{ if(variable1>=6&&variable1<9){ gotoAndStop(3); } as you can see, it takes less logical confusion to use the switch statement then it would to use an IF-Else. The way to read the above is: if variable1 is greater than or equal to 3, and less than 6, then go to and stop on frame 2...if it's greater than or equal to 6, and less than 9, then go to and stop on frame 3. The syntax is radically different between the two, so you should definitely decide which one would work best BEFORE you type it out.
Leave a comment!
html comments NOT enabled!
NOTE: If you post content that is offensive, adult, or NSFW (Not Safe For Work), your account will be deleted.[?]

giphy icon
last post
16 years ago
posts
6
views
1,209
can view
everyone
can comment
everyone
atom/rss

other blogs by this author

 14 years ago
projects
 15 years ago
Me So Fickle...
 15 years ago
Watch Out...
 15 years ago
random junk
 16 years ago
Why I came here...
 16 years ago
Work Blogs...Fun
 16 years ago
Character Bios
 16 years ago
Writing Tips
official fubar blogs
 8 years ago
fubar news by babyjesus  
 13 years ago
fubar.com ideas! by babyjesus  
 10 years ago
fubar'd Official Wishli... by SCRAPPER  
 11 years ago
Word of Esix by esixfiddy  

discover blogs on fubar

blog.php' rendered in 0.0617 seconds on machine '189'.