Thanks Adrian, your code works exactly like mine "should" but for some
reason mine doesnt get the same results (though its the same code) ;)
Mike Boutin
Adrian Lynch wrote:
Just took your code and plonked it in a new .fla and it works for me. Is
anything else happening in the movie or any included movies?
See it here: http://www.adrianlynch.co.uk/temp/colours.fla
Ade
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Mike
Boutin
Sent: 20 December 2005 23:41
To: Flashcoders mailing list
Subject: [Flashcoders] Wierd split
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
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders