|
Posted by Oli Filth on 03/18/06 15:55
Onideus Mad Hatter said the following on 18/03/2006 12:59:
> DUM DUM DUM DUM...
>
> square._x = eval("dates._"+i+"._x") + 566;
>
> If you're trying to assign a property of a variable variable to
> another objects property you sure as fuck need it (well in
> Actionscript anyway).
Except that the eval() function in Actionscript is fundamentally
different to the eval() in say JavaScript or PHP - it can *only* be used
to reference variables/objects via a string; it can't evaluate arbitrary
code. And the only reason you have to do it this way is because older
versions of Flash didn't have proper arrays, etc.
P.S.
As to your subject line, if you're referring to that time when you were
attempting to justify:
eval(a + b)
[where a and b were numeric values]
as an appropriate use ("use" is a bit of a strong word, cos it implies
that it's actually serving some purpose) of eval() in JS, it still isn't.
--
Oli
Navigation:
[Reply to this message]
|