|
Posted by cheesepants on 03/20/06 02:55
It should be:
square._x = this["dates"+i]._x + 566;
Anyone who actually uses Flash on a daily basis stopped using eval() a
long time ago. Why? Cause it don't work no more, and it was a hack in
the first place for what you are trying to do. If you're just trying to
put together a string that contains the value of a variable, use array
notation.
>From the docs:
---------
In Flash 4, eval() was used to simulate arrays; in Flash 5 or later,
you should use the Array class to simulate arrays.
In Flash 4, you can also use eval() to dynamically set and retrieve the
value of a variable or instance name. However, you can also do this
with the array access operator ([]).
In Flash 5 or later, you cannot use eval() to dynamically set and
retrieve the value of a variable or instance name, because you cannot
useeval() on the left side of an equation. For example, replace the
code
eval ("var" + i) = "first";
with this:
this["var"+i] = "first"
or this:
set ("var" + i, "first");
-------------------
Or check out:
http://www.actionscript.org/tutorials/intermediate/advanced_pathing/index.shtml
Navigation:
[Reply to this message]
|