Groups | Blog | Home
all groups > flash actionscript > april 2004 >

flash actionscript : Multiple Arrays question - help...


BillinAZ
4/12/2004 11:17:32 PM
Hola,
I'm trying to build subpages in a menu system. I have the chapter headers
built dynamically. Now i need to build the sub pages. The headers were built
with a specific number.. the pages however will vary. I'm trying to create a
'for' statement, but can't figure out how to set the Array length to a
variable... see below:

for(var i=0; i<myArray(this is the variable, number, whatever that i don't
know how to get...).length; i++){
rest of for statement...
}

Basically there are X number of arrays called "myArray1", "myArray2",
"myArray3", and so on. Since the number of arrays will vary i can't use a hard
number.

Suggestions or ideas would be most helpful
thx

B
Peter Blumenthal
4/13/2004 9:01:41 AM
Presumably you are setting a variable somewhere, equal to the array number.
For example...

var nArray = 2;
for (var i = 0; i<this["myArray"+nArray].length; i++){
//whatever
}


HTH
}`P¬

--
---------------------------------------
http://www.phageinteractive.com
PhageInteractive Ltd.
remove mm_ to mail
---------------------------------------
'If I come across as a grumpy and twisted old man, it's just because I'm a
grumpy, twisted, old man." - me
---------------------------------------

AddThis Social Bookmark Button