| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Dec 2001
Location: UK
Posts: 27
|
HELP ME SOMEONE PLEEEEASE!!! I need to create a multi-dimensional array...(?) - and thats all I know.... (well almost!)
|
|
|
|
|
|
#2 |
|
Even graphists R objects
Join Date: Jun 2001
Location: Paris
Posts: 270
|
The thing is to build arrays of arrays.
For instance, you can define a two dimensional array like this : var tMultiArray = new Array(); tMultiArray.push(new Array()); tMultiArray[0].push("toto"); tMultiArray[0].push("titi"); trace(tMultiArray[0][0]); trace(tMultiArray[0][1]); will give you that output : toto titi Hope it helps, BZen
__________________
Oh Lord, shut me down ! |
|
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: May 2002
Location: Belgium - Antwerp
Posts: 451
|
I was looking for a solution on the forums and this thread was close to my problem so maybe someone could help me...
How do you "push" two arrays? ActionScript Code:
|
|
|
|
|
|
#4 |
|
six eyes
|
your problem is tMultiArray[0] isnt an array when you try to push something on it. you have to make it one first...
ActionScript Code:
__________________
(6) |
|
|
|
|
|
#5 |
|
New Member
Join Date: Jan 2001
Posts: 245
|
The most straightforward way is to make each array element an array-
tMultiArray = new Array(); tMultiArray[0] = new Array(); tMultiArray[1] = new Array(); . . . tMultiArray[n] = new Array(); tMultiArray[0][0] = "a"; tMultiArray[0][1] = "b"; etc. trace(tMultiArray[0][0]+" . "+tMultiArray[0][1]); ~mgb |
|
|
|
|
|
#6 |
|
Registered User
Join Date: May 2002
Location: Belgium - Antwerp
Posts: 451
|
|
|
|
|
|
|
#7 |
|
[^\d\D]
Join Date: Jun 2001
Location: Brooklyn, NY
Posts: 3,254
|
Like dees, mayn!
ActionScript Code:
|
|
|
|
|
|
#8 |
|
Peter Tang
Join Date: Dec 2007
Location: Singapore
Posts: 8
|
I having the headache on the multi-dimensional array for the past few days. Finally I got it solved after reading through the thread overhere. Thanks.
But I still have the question for the Push in the script here. What do this push do in the array? I could not understand? Can anyone tell me more about it? Thanks in advanced. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| two dimensional arrays with shared objects! | blucinzano | ActionScript 2.0 | 2 | 11-29-2007 06:01 PM |
| multi level arrays | panix | ActionScript 1.0 (and below) | 1 | 03-22-2004 04:20 AM |
| Initialising 2 dimensional arrays | ferdymania | ActionScript 2.0 | 4 | 10-31-2003 09:24 PM |
| Multi dimensional array | Bob Sheehy | ActionScript 1.0 (and below) | 1 | 03-01-2002 09:11 PM |
| 2 Dimensional Arrays | Manifestation | ActionScript 1.0 (and below) | 10 | 01-27-2001 01:08 AM |