4 Replies Latest reply on May 2, 2007 8:52 PM by ggshow

# &quot;If&quot; with multiple conditions

I have 8 items, and when they are all moved to _x = 800, I want the timeline to move to frame 12.
Below I have the script I wrote so far, that isn't working. Please tell me how to write this script correctly.

stop();

if ((_root.l01._x == 800)
(_root.l02._x == 800)
(_root.l03._x == 800)
(_root.l04._x == 800)
(_root.l05._x == 800)
(_root.l06._x == 800)
(_root.l07._x == 800)
(_root.l08._x == 800));

{

gotoAndPlay(12);

}
• ###### 1. Re: &quot;If&quot; with multiple conditions
yeaa....

if (clip._x == 800) { place.gotoAndPlay(12);}
if (clip2._x == 800) { place.gotoAndPlay(12);}
if (clip3._x == 800) { place.gotoAndPlay(12);}

OR you could use a for loop

for (i=1;i<=8;i++) {
if (eval("clip" + i )._x == 800) { place.gotoAndPlay(12);}
}
• ###### 2. Re: &quot;If&quot; with multiple conditions
Use the logical AND (&&) operator to join your conditionals together, that is:

if ((_root.l01._x == 800) && (_root.l02._x == 800) && (_root.l03._x == 800) &&(_root.l04._x == 800) && (_root.l05._x == 800) && (_root.l06._x == 800) &&(_root.l07._x == 800) && (_root.l08._x == 800))
{
gotoAndPlay(12);
}
• ###### 3. Re: &quot;If&quot; with multiple conditions
OH, you want it to go to 12 after ALL of the them are at 800? then Nsurveyor is right.