This content has been marked as final. Show 10 replies
That would work just fine if I didn’t have any child elements. However I do have child elements in which some of them will be identical but belonging to a different parent element.
I still don’t understand why that last trace statement comes up ‘undefined’. I don’t fully understand ‘casting’ datatypes but it seems that this just might be an instance that it could be used.
Any other suggestions? Thanks again.
what's the problem. that code works fine with nodeAttrib just as you created it with child elements. eg,
should reference the frequency variable of the first element added to this.groupChannel.
I don’t think I understand kglad. In the diagram below;
...‘A’, ‘B’ and ‘C’ are the parent elements of groupChannel. I need to have the child elements of each of them to be associative arrays (Objects). All child elements will have the same attributes (channel, frequency, mode) that may have the same or different values.
What I need from a design perspective is to allow the user to traverse thru the attributes of the child elements (eg. channel to frequency to mode, etc.) and thru the child elements (eg. ‘a’ to ‘b’ to ‘c’, etc.). The parent elements (A, B, and C) will not have any attributes. The user will also be able to traverse with these parent elements.
So by having;
That is assigning an associative array/Object to the parent element. Correct? So I need to do something like below;
or, but doubting
But for some reason I cannot trace any values from it. And in an addition to this I need to have ‘nodeAttrib’ to be dynamically named. So perhaps;
or, but doubting
But this syntactically is incorrect.
Is it even possible to push an associative array into an array? I am starting to think not. I can’t even get positive trace outputs from the code below.
see my above messages for the correct syntax to access the arrays elements. or again:
p.s. you're not really creating an associative array with your nodeAttrib statement. you're creating an object with properties.
The code below is what I was trying to get at the time I started this thread. Creating an object and having an array inside of this object that’s capable of having multiple objects of its own. If you copy and paste the code below into Flash and use the Debugger when compiling you can see this object under ‘variables’.
“p.s. you're not really creating an associative array with your nodeAttrib statement. you're creating an object with properties.”
I believe that is what an associative array is at least it is according to the livedocs. It looks like you can create an instance of the Object class or the Array class to make an associative array.
is your problem solved?
yes. Thanks for your time again kglad!