-
ex.
eval("String"+varNumber)=thisProperty;
this doesn't work.
rats.
this feels like a rookie q, but in flash mx i apparently cannot create a assignment name dyamically when i set a new var.
how do i do it in flash mx?
thanks
JWT
-
thisProperty = eval("String"+varNumber);
-
heh
i apologize, i was not spec enough:
eval( "string" + count ) = unescape( eval("string" + count) );
both sides are eq's
thanks again
-
hmmm... i'm not sure exavtly what you want to do but i set up this thing...
Code:
count = 1;
thisIstest2 = "test1";
MyString1 = "test2";
thisStringCount = eval("MyString" + count);
thisEval = eval("thisIs" + thisStringCount);
trace(thisEval); //test 1
trace(thisStringCount); //test 2
-
thanks solo for your time. it is much appreciated.
yes, that will work great.
i was hoping for perhaps a less "roundabout" way to do it, since i'm using it in a "for" statement for generating about 7 vars for each of 10 items. so it gets messy. but it's all good.
an offhand question - this used to work in flash 5, but not in mx anymore... anyone know why? practical advantages? just curious
thanks
jwt
-
This can be done without eval in both 5 and MX.
Associative array syntax.
whatever = this["string"+i];
-
lol
thanks yeah i assumed there was a syntax trick of SOMEthing i was missing.
i feel much better.
once again thanks!
-
Originally posted by oldnewbie
This can be done without eval in both 5 and MX.
Associative array syntax.
whatever = this["string"+i];
can i do
_root["string"+a] = this["string"+i]
?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|