> From: Henrik Andersson <[email protected]>
> To: Flash Coders List <[email protected]>
> Sent: Friday, August 12, 2011 1:43 PM
> Subject: Re: [Flashcoders] Simplify XML Call
>
> ActionScript 3 is a compiled language. There is no such thing as an eval
> function in as 3.
Well, that's the crux of my problem, Henrik. How do I get around writing code
that adds just the right number of "item units" without doing it as a string to
evaluate or writing a switch statement that's obviously limited? Again, here's
my pseudo-code:
var j:String = "xml.menu.item[whichItems[0]]";
var k:String = new String();
var l:int = level; // I don't know this value in advance: it's
passed to the class
while (l--)
{
k += ".item[whichItems[" + String(l) + "]]";
}
totalItems = eval(j + k); // "eval()" doesn't work in AS3, concept
from Python
TIA,
John
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders