|
|||
|
Sorry if it was already posted, i'm new here.
I don't know ECMA specification about this, but it seems that associativ arrays are not supported in FFish ( they are in Actionscript and Javascript ). Are you planning to support it ? Code:
var _array = new Array(); _array[ 3 ] = 123; // ok _array[ "test" ] = 456; // error (invalid index) M. |
|
|||
|
Below some further explorations: This approach seems to work and provides a useful basis for some data structures.
var objArray = new Object(); objArray[1] = 1; objArray[2] = 2; objArray[3] = 3; objArray['index1'] = 'string_1'; objArray.index2 = 'string_2'; trace (objArray[1]); trace (objArray['index1']); trace (objArray.index2); objArray.index3 = objArray[3]; for (var ndx in objArray) { trace(ndx + ':' + objArray[ndx]); } Trace: 1 string_1 string_2 __proto__:3 index3:3 index2:string_2 index1:string_1 |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|