Accessing Level with variable

maybe this problem has been adressed before but i couldn’t find it…

i try to be so clear as possible and i tell you it is not easy in my confused state of mind

i have this problem where i want to put different swf’s on a higher level on the click of a button in a row of buttons where i takes the instance name of the button -thats why this.butaction is in my script - clicked and puts the swf on the stage

all the loading works fine but for some reason i cant access the loaded movie clip to play or unload… i know that loading it on the same level would be a solution… but i want it to appear and dissapear with a litle animation

so every loaded movie needs to be loaded on a higher level…

here is the code i use

on the first frame of the timeline i say:[COLOR=royalblue]
_global.loadlevel = 3;[/COLOR][COLOR=darkred]
//since i want the first time i load a clip to load on _level3
[/COLOR]

on the button it says:[COLOR=royalblue]
on (release) {
level = ((_global.loadlevel)-1);
‘_level’+level.gotoAndPlay (15)
loadMovieNum(this.butAction+’.swf’, _global.loadlevel);
_global.loadlevel++;
}[/COLOR][COLOR=darkred]
//when i do a trace anywhere in my code it gives me the correct level numbers
[/COLOR][COLOR=red]
so very desperado i’m trying to solve the problem for a couple of days now…
hopefully someone can help me…
[/COLOR]

tnx redg

level = ((_global.loadlevel)-1);

you should change that to

level = ((_global.loadlevel)+1);

that way each time it goes up one level … if you have it set at 3 and then you subract 1 all you’re going to get is 2, 1, 0 then you’re out of levels. actually i think you could take the +1 out altogether and it would work fine.

additionally, you might have a problem with something else being loaded on the same level. so try a higher number like 254 or something instead of 3 … that way if you have anything else that is occupying the lower levels it won’t matter.

hope this helps

hey shuga tnx for the input anyway…
but it doesnt work…
as i was writing a reply to your answer…
someone else served me de answer…

i just have to say

            level = "_level"+((_global.loadlevel)-1);
eval(level).gotoAndPlay(15);

this eval pulls the string out of the variable
:slight_smile: