I am trying to loop through a conditional and rotate movie clips dynamically. My code (that doesn't work) is the following :
function getData_Result(result) {
_root.relations_ds.dataProvider = result;
angelDiv = Number(360/_root.relations_ds.dataProvider.length);
for (g=0; g<_root.relations_ds.length; g++) {
toRotate = String(Number(angelDiv * g));
eval("_root.stem"+g+"_mc._rotation = '120'");
}
}
The problem is with the eval function.. doesn't rotate anything. I'm sure this is just a syntax error, but I can't figure out how to get it to work.
function getData_Result(result) {
_root.relations_ds.dataProvider = result;
angelDiv = Number(360/_root.relations_ds.dataProvider.length);
for (g=0; g<_root.relations_ds.length; g++) {
toRotate = String(Number(angelDiv * g));
eval("_root.stem"+g+"_mc._rotation = '120'");
}
}
The problem is with the eval function.. doesn't rotate anything. I'm sure this is just a syntax error, but I can't figure out how to get it to work.