Link to home
Start Free TrialLog in
Avatar of WebArchitect_Vince
WebArchitect_Vince

asked on

Getting Object Info

I'm trying to create a listbox of items within my Object. Below is the structure of my object, basically I want to be able to loop through the object and extract 'defaultControls' and 'controlSet1' from it.

Variable _level0.my_so = [object #237, class 'SharedObject'] {
    data:[object #238, class 'Object'] {
      defaultControls:[object #239, class 'Object'] {
        0:[object #240, class 'Object'] {
          screenname:"ios",
          icon:3,
          bkgd:0,
          template:3,
          selected:true,
          deleted:false,
          },
          prev:[object #240, class 'Object'],
          c:1
        }
      }
      controlSet1:[object #240, class 'Object'] {
        0:[object #240, class 'Object'] {
          screenname:"ios",
          icon:3,
          bkgd:0,
          template:3,
          selected:true,
          deleted:false,
          },
          prev:[object #240, class 'Object'],
          c:1
        }
      }
    },
    onStatus:[function 'onStatus']
  }


So far i've tried:

      for (i in _root.my_so.data){
      fileList.addItem(_parent.my_so.data[i]);
        }

      for (i in _root.my_so.data){
      fileList.addItem(_parent.my_so.data[i].name);
        }

      for (i in _root.my_so.data){
      fileList.addItem(_parent.my_so.data[i].label);
        }

none of these are giving me the output i want. Please help!
Avatar of JabbyPanda
JabbyPanda

What type of data do you want to be displayed in List component?

You mentioned, you want to list items 'defaultControls' and 'controlSet1'  from  your 'my_so' object.

If you will type trace (_root.my_so.data.defaultControls); you will see no literal output.

You can add a property 'objectName' of a type String to the 'defaultControls' and 'controlSet1'  objects and output the value of this property in List.
ASKER CERTIFIED SOLUTION
Avatar of krishnaprathab
krishnaprathab

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WebArchitect_Vince

ASKER

I've come to the conclusion that the only way to do it is to add a unique id to each object and call it using that name instead.

Thanks for your help guys.

Mod: Please close this question
No Assist :(