all groups > flash actionscript > july 2007 >
You're in the

flash actionscript

group:

How to retrieve the name of an array?


How to retrieve the name of an array? Bob Pierce
7/31/2007 8:59:43 PM
flash actionscript:
I can name an array so that it includes an index value like this:

this["myArray"+i] = new Array();

Re: How to retrieve the name of an array? kglad
7/31/2007 9:01:18 PM
:



Re: How to retrieve the name of an array? Bob Pierce
8/4/2007 5:03:06 PM
Thanks kglad, but I didn't make myself clear. Having created a number of arrays
with names that include an index number I want to be able to extract that index
number in order to identify the array later. If this was a MovieClip I would
use substr() etc with mc._name, but arrays have no _name property. I guess I
can store the index in the first element but I'd prefer not to.

Thanks

Bob
Re: How to retrieve the name of an array? kglad
8/4/2007 5:11:36 PM
no, that looks pretty clearly stated. i just didn't read it.

you can assign a name property to your arrays or really just the index
property because that's all you want:



this["myArray"+i].index = i;
Re: How to retrieve the name of an array? Bob Pierce
8/4/2007 11:10:15 PM
Re: How to retrieve the name of an array? kglad
8/4/2007 11:23:39 PM
AddThis Social Bookmark Button