PDA

View Full Version : [FMX] loadmovie with variables



Maizoon
January 4th, 2004, 06:12 PM
Hi,

I have this script on my main timeline:

stop();
this.createEmptyMovieClip("tntHolder", 2000);
this.tntHolder._x = 0;
this.tntHolder._y = 100;
onEnterFrame = function() {
if (MyTalent != CrtTalent) {
tntHolder.loadMovie("talent/talent"+MyTalent".swf");
CrtTalent = MyTalent;
}
};

and on a button:

on (release) {
MyTalent = "0";
}
now...this doesn't do anything, if i change the line reading:
tntHolder.loadMovie("talent/talent"+MyTalent".swf");
to read:
tntHolder.loadMovie(MyTalent);
and change:
MyTalent = "0";
to
Mytalent = "talent/talent0.swf";

it works, but alas I can't have it done like this. It needs to be variable driven so I can do things like "next" or "previous" and whatnot. I know my loadMovie code is butchered, but I have no idea how to incorporate something dynamic (MyTalent) into something static (talent/talent(variable).swf) I tried basing this code off a for loop, but as you can see that didn't get me very far :-P

Thanks

norie
January 4th, 2004, 06:23 PM
tntHolder.loadMovie("talent/talent"+MyTalent+".swf");

Maizoon
January 4th, 2004, 06:31 PM
sweet, thanks