Im having a wierd problem with using .split on an array. I create an array 3 frames before in the same timeline like so:

_root.cat_colors = new Array();
_root.cat_colors[0] = "bob,john,betty";


Then 2 frames down the timeline I run a loop like so:

for (i=0; i<_root.cat_colors.length; i++) {
trace("String: "+_root.cat_colors[i]);
  // The string traces properly here ex. bob,jim,john etc...

   var tempColor:Array = _root.cat_colors[i].split(",");
   trace("Total: "+tempColor[i]);
   // traces out undefined for the next loop never happens

   for (j=0; j<tempColor.length; j++) {
      trace("Color: "+tempColor[j]);
   }

}


Anyone know why this doesnt work? is there another way to achieve this? If i create the array on the same frame as the loop, everything works like it should.


Thanks!
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to