How do I fix this?

Plz check this script.

what am I doing wrong?

 
this.onEnterFrame = function() { 
       if (_root.bgm.is_playing == true) { 
               n = eval("_level100.s" + (substring (_name, 5, 2))); 
               _y = (orig_y - n); 
       } else { 
               eval("_level100.s" + (substring (_name, 5, 2))) = null; 
               _y = orig_y; 
       } 
} 

output=
Frame=1: Line 7: Left side of assignment operator must be variable or property.
eval("_level100.s" + (substring (_name, 5, 2))) = null;

but still can’t get it to work. I must be :crazy:

Thanks:crazy:

It’s saying that the eval function can not be placed on the left side of an operation line…

Therefore… It’s trying to look for a variable to hold null… And it can not find one.

:cool: Therefore…

You wanna set another variable to equal that eval statement and then call a _root[eval("_level100.s" + (substring (_name, 5, 2)))] = null;

Try that out and see if it works better for you. If it doesn’t… I’d suggest using another variable set.

That works … Thanks !!!