Help With a Simple Conditional Statement

I’m struggling a bit with a conditional statement…I thought I’d run it by you folks
I’m certain what I’m trying to do is extremely simple but I cant seem to nail it.

Here’s the senario…

I have a container SWF movie that loads other child SWFs (in a sequence) upon request.

The I’d like to have the child movies load the next child movie (of the sequence) into the Container SWF once it’s been viewed.

No problem right…I just put a frame action at the end of each child movie that tells the Container SWF which is the next Child SWF to load - that’s easy.

Here’s the kicker…

The child movies have to have the ability to be viewed solo in an HTML page as well as when loaded into a Container SWF. So if I put a frame action at the end of each child movie that tells the Container SWF which is the next Child SWF to load and there’s no Container movie present - that’s a problem.

So this is what I’m trying to do.

I will pass a variable form the embed parameter of the solo HTML pages that would tell the Child movie that it’s supposed to behave as a solo movie.

Basically, I’ll set the value of a variable in the embed parameter (i.e. solo=yes)

Then, on the second to last frame of each of the Child SWFs I’ll put a conditional statement of some sort that says “IF the value of solo = yes, then stop here, otherwise play on brother” then on the last frame is where I would put the frame action that tells the Container SWF which is the next Child SWF to load.

Does this make sense?

Could you help me with the syntax?

this doesnt seem to work:

if (solo==yes) {
stop();
}
else {
play();
}

What am I missing? Any help would be greatly appreciated.

well joel,

first of all, i like super neat code, and that includes not putting things that need to be there, for instance, you dont need the ‘else’ part of the conditional…this is because, obviously if solo doesnt equal yes and what not…then the timeline simply needs to do nothing and just keep on playing.

so im guessing when you run this timeline…if solo eq yes it doesnt stop huh?

your sintax looks right, unless i miss read it…so my only other thought is that you havent referenced when the solo variable is, is it on the _root or is it within a movieclip?

just like movieclips, variables also have locations in reference to _root, does that make sense?

and where is this conditional statement, is it on the _root timeline or is in aother movieclip?

just a thought…

thanx for the advice blackPulp.

I think it was the way I was loading the variable - good call.

I think I now have a handle on things.

Thanx for your time and consideration.

jOEL

if im understanging you right, and i’d like to think that i am,
you’re having trouble accessing the _root.container Movie Clip on the main page right?..

if thats the case then try this…

Inside your childSwf, to load the next movie you could try
this code

_parent.containerMc.LoadMovie("whatever.swf");

(this is right off my head so forgive me for little disceptancies…)

the _parent property means… well the parent. its like going up one level… and since you have your main movie, and your child, the _parent should work…

=)