PDA

View Full Version : if statement


1ok
03-01-2003, 01:30 PM
Hi everyone

This is my first post here.

I've got a very simple question.

I'm trying to use the if statement. I know the right syntax is:

if (condition is true) {
do this
do this
};

But all the examples I've seen use variables to state the condition, and I'm not sure if it's possible to write something like this:

if (movie clip x is on frame 5) {
play movie clip x
};

Note: I'm talking about the frame 5 that is inside the movie clip.

I apologize about my english.
Thanks everyone !

[]'s

Billy T
03-01-2003, 03:14 PM
if(mcInstance._currentframe==5){
mcInstance.play();
}

cheers

1ok
03-02-2003, 01:36 AM
Thanks Billy T

I'll try this sintax :)

sandman9
03-02-2003, 01:45 AM
if it's a MC then won't it play on it's own when it reached frame 5?

Sandman9

Billy T
03-02-2003, 01:50 AM
not if there's a stop action in frame 5

1ok
03-02-2003, 01:57 AM
Well, in fact what I really wanted to do is to play the MC only if they were on frame1.

If I press the button for the first time, it plays the MC until it stop on frame 5

So I just had to change what Billy T wrote to:

if(mcInstance._currentframe==1){
mcInstance.play();
}

Bingo ! :)