  | |  | replacing conditional with a string | replacing conditional with a string
2004-02-23 - By Paulo Meconi
Back I 've been reading this list for a couple of days now (btw fascinating
and educational) and I 'm pretty sure this is the correct place to ask
this question. In order to make my code generic I want to replace this
code on a movieClip:
?
if (!m1.over & !m2.over & !m3.over & !m4.over & !m5.over &
!m6.over) {
_root.visor.target = lastPosition;
}
?
with something like this on the first frame of the root movie:
?
menuItems = 6;
conditional = " ";
for(i=1; I < menuItems; i++) {
conditional = conditional + "!m " + i + ".over & ";
}
conditional = conditional + "!m " + i + ".over ";
?
plus this on the movieClip:
?
if (conditional) {
_root.visor.target = lastPosition;
}
?
but it doesn 't seem to work.
?
I 've also tried:
?
if (eval(conditional)) {
_root.visor.target = lastPosition;
}
?
but no luck. I 've checked the string (conditional) a couple of times and
it seems to be constructing ok.
?
I thought this was possible. Am I missing something? Or is it just
impossible? Any ideas on how to do the same but in a different manner?
?
Cheers to all,
Paulo
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Supported by Fig Leaf Software
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Be sure to check the archives and the wiki:
http://chattyfig.figleaf.com/
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:105016
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)
|
|
 |