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.m y_so.data[ i]);
}
for (i in _root.my_so.data){
fileList.addItem(_parent.m y_so.data[ i].name);
}
for (i in _root.my_so.data){
fileList.addItem(_parent.m y_so.data[ i].label);
}
none of these are giving me the output i want. Please help!
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.m
}
for (i in _root.my_so.data){
fileList.addItem(_parent.m
}
for (i in _root.my_so.data){
fileList.addItem(_parent.m
}
none of these are giving me the output i want. Please help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
Thanks for your help guys.
Mod: Please close this question
No Assist :(
You mentioned, you want to list items 'defaultControls' and 'controlSet1' from your 'my_so' object.
If you will type trace (_root.my_so.data.defaultC
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.