PDA

View Full Version : The World According to VAR... or why the -snip- it doesn't work (F5)



ericinho
May 2nd, 2003, 11:00 AM
picture this:

on the root:

1 SWF loaded, 1 MC called CONTENT

the SWF contains 3 buttons, on Release it loads another SWF into that content MC.
it also sets a VAR called thumbkids and it's set to 1 or 2 or 3 (depending on which button you press)


on (release) {
_root.nextMovie = "externalswf.swf";
_root.cover.gotoAndPlay("close");
_root.thumbkids = "1";
}

---

inside the to be loaded 'externalswf.swf' there is the following action:

if (_root.thumbkids = "1") {
_root.content.gotoAndStop("4");
}
if (_root.thumbkids ="2") {
_root.content.gotoAndStop("5");

}
if (_root.thumbkids = "3") {
_root.content.gotoAndStop("6");

}

else {
_root.content.gotoAndStop(3);
}


--------

so after loading the swf goes automatically to that frame and the var should make sure that it goes to the correct frame...

but as you guessed already, it doesn't work :(

i am fairly weary, so I am surely missing an easy solution, so your help is much appreciated

Jubba
May 2nd, 2003, 11:15 AM
it should be:

if(_root.thumbkids == "2")

there should be two =s

ericinho
May 2nd, 2003, 11:49 AM
yeah, figured that out as well, but still doesn't work.

it constantly plays the 'else' path...

shouldn't I put in the first if action an 'else if' instead of an if

???

imvain2
May 2nd, 2003, 01:43 PM
have you tried:

switch (_root.thumbkids) {
case 1:
_root.content.gotoAndStop("4");
break;
case 2:
_root.content.gotoAndStop("5");
break;
case 3:
_root.content.gotoAndStop("6");
break;
default:
_root.content.gotoAndStop(3);
}

imvain2
May 2nd, 2003, 01:44 PM
Sorry all my tabs got messed up