hello im a flash beginner i got a stupid Q

hope u guys can help me solve it out.
i've created a slider which when user move the slider bar, the movie clip above it will change...i got 3 movie clips. when i move the bar between number 1-25 first movie clip will appears. then the second movie clip will appear when i move the bar from 26-50 and so on..it supposely to be like what i have say but its not working.
here is my coding:
- Code: Select all
this.onEnterFrame = function() {
sliderValue.text = slider.perc;
var y:String= sliderValue.text;
if (y>=1 && y<=25) {
var x:String = "mc1";
write(x);
}
else{
var x:String = "mc2";
write(x);
}
};
function write(x:String):Void {
switch (x) {
case "mc1" :
this.createEmptyMovieClip("mc", 2);
this.mc.loadMovie("mc2.swf");
mc._x = 73;
mc._y = 73;
break;
case "mc2" :
this.mc.attachMovie("mc",1);
_root.createEmptyMovieClip("mc", 1);
_root.mc.loadMovie("mc1.swf");
mc._x = 73;
mc._y = 73;
break;
default :
trace("default");
}
}
is there any wrong with my codes?could anyone help me to solve it..