Search tutorials
An If function does something depending on a value of a variable.
Something like:
if (this variable is true) {
do something
}
Remember that the ones in parenthises "( )" are the cause,
and the ones in brackets "{ }" are the effect. So if you
want to go to frame 3 IF the variable "frame" is '1',
if (_root.frame == 1){
_root.gotoAndStop(3);
}
NOTE: See the equal signs (=) in the parenthises?
You can change that depending on what you want:
_root.frame == 1 -- If variable is EQUAL to one
root.frame <= 1 -- If variable is LESS THAN OR EQUAL TO 1
root.frame >= 1 -- If variable is MORE THAN OR EQUAL TO 1
If you want the effect to happen if the variable
ISN'T 1, add this:
if (!_root.frame == 1){
_root.gotoAndStop(3);
}
See anything different? the "!" in the parenthises.
The "!" means 'Is not'.
Something like:
if (this variable is true) {
do something
}
Remember that the ones in parenthises "( )" are the cause,
and the ones in brackets "{ }" are the effect. So if you
want to go to frame 3 IF the variable "frame" is '1',
if (_root.frame == 1){
_root.gotoAndStop(3);
}
NOTE: See the equal signs (=) in the parenthises?
You can change that depending on what you want:
_root.frame == 1 -- If variable is EQUAL to one
root.frame <= 1 -- If variable is LESS THAN OR EQUAL TO 1
root.frame >= 1 -- If variable is MORE THAN OR EQUAL TO 1
If you want the effect to happen if the variable
ISN'T 1, add this:
if (!_root.frame == 1){
_root.gotoAndStop(3);
}
See anything different? the "!" in the parenthises.
The "!" means 'Is not'.
| » Level Basic |
|
Added: 2006-05-23 Rating: 8 Votes: 19 |
| » Author |
| PacoBell Rulz PacoBell Rulz PacoBell Rulz PacoBell Rulz |
| » Download |
| Download the files used in this tutorial. |
| Download (0 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!