Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Eval problem Please help 1

Status
Not open for further replies.

tchaplin

Programmer
Jul 18, 2003
58
NZ
Im trying to make some legacy changes to a flash file (fla) and confess that I don’t know flash action scripts. When I convert the file to swf there is a error on this line

eval("No" + x) = "" + ICBox[x];

I’m aware that in Flash MX, you're no longer allowed to use eval on the left side of assignment which is what the error is about . It says that you should use the Set insted

So what should the line look like Please Help

Its used in the context

stop();
if (Found != "True")
{
gotoAndPlay(4);
}
else
{
var ICSounds = _root.IC.split(":");
var ICBox = _root.Box.split(":");
var ICPrice = _root.Price.split(":");
for (x = 0; x <= 20; x++)
{
if (ICSounds[x].length > 0)
{
var Voice = "IC" + ICSounds[x] + ".mp3";
objSound = eval("IC" + x);
objSound.stop();
objSound.loadSound("../sounds/" + Voice, false);
eval("No" + x) = "" + ICBox[x];
} // end if
} // end of for
play();
} // end if




 
Thanks for the reply

I managed to figure it out - Flash MS doesn't like the Eval statement. So I used the set statement instead which looks like

set("No" + x, ICBox[x]);







 
Thanks for the replys kennethkawamoto although ity was already solved Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top