A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: An array within an object with in an array

  1. #1
    a.k.a gltovar deadlock32's Avatar
    Join Date
    May 2001
    Location
    Naperville,IL
    Posts
    489

    An array within an object with in an array

    Is anyone able to give me an example of this?

    problem example:
    ArrayC has 2 vars

    into ObjectB which as Array C as well as 2 vars

    Into ArrayA which as ObjectB.


    ArrayA[0].objectB[0].ArrayC[1] = 1;
    ArrayA[1].objectB[0].ArrayC[1] = 4;

    any one give me an example of what this code would look like?

    currently I've got ArrayA.ObjectB working OK, but implementing ArrayC just doent seem to want to stick.

  2. #2
    Senior Member
    Join Date
    Jan 2006
    Location
    USA
    Posts
    383
    I'm not sure if this is what you're talking about:

    code:
    var arrayA:Array = new Array(2);

    arrayA[0] = new Object();

    arrayA[1] = new Object();

    arrayA[0].arrayC = new Array(2);
    arrayA[1].arrayC = new Array(2);

    arrayA[0].arrayC[0] = 1;
    arrayA[0].arrayC[1] = 4;

    arrayA[1].arrayC[0] = 2;
    arrayA[1].arrayC[1] = 6;

    trace(arrayA[0].arrayC);
    trace(arrayA[1].arrayC);


  3. #3
    a.k.a gltovar deadlock32's Avatar
    Join Date
    May 2001
    Location
    Naperville,IL
    Posts
    489
    Thanks for the speedy responce... I forgot to mention that the values for said object and arrays are dynamic and loaded from xml

    I am having issues using the push command

    entire = new Array();
    middle = new Object();
    specific = New Array(); // specific is defind in middle

    for(i=0;i<middle.someAmount;i++){
    //tracing here middle.getXMLValue returns the correct value
    specific.push(middle.getXMLValue);
    }
    //middle.specific[x] = undefined

    entire.push(middle);

    going into the debuger entire expandes to 0 and 1. each 0 and 1 has the middle values but the specific is not an array, it doesn't even have one value.
    Last edited by deadlock32; 05-08-2006 at 10:29 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center