Help targeting movie clips

I’m hoping someone can help me out. I have one scene with two movie clips (both are instances in frame one of scene one). Is something wrong with my syntax below, because when I change the value of “x” it’s not going to the correct frame in the movie clip. Thanks!

x=3
if (x=1) {
_root.clipone.gotoAndPlay(15);
} else if (x=2) {
_root.cliptwo.gotoAndPlay(5);
} else if (x=3) {
_root.cliptwo.gotoAndPlay(20);
} else {
stop();
}

= is assignment wichi means x=3 means x is given value 3
== is equivalence which means x==3 is compared to 3

so in your if statement you need ==
ie if(x==1)
{
}

Happy Scripting