?
Solved

Getting Object Info

Posted on 2004-03-25
4
Medium Priority
?
161 Views
Last Modified: 2010-04-03
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!
0
Comment
Question by:WebArchitect_Vince
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Expert Comment

by:JabbyPanda
ID: 10680823
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.
0
 
LVL 9

Accepted Solution

by:
krishnaprathab earned 2000 total points
ID: 10702095
Though I dont understand your code fully Iam just trying to help you out with my very little knowledge.

The first odd thing which I see in the code is that you are trying to populate the list box with an Object which is not possible.

Second , your my_so object doesnt contain a "name" property which you can directly refer to. As I can learn from your code your Object structure is something like : my_so ( data ( defaultControls ( 0 ( screenname, icon,.....) ) ) ) so if you want to get the value of screename you would write a code something like _level0. my_so.data.defaultControls.0.screenname.

The third is your addressing method :

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

Intially you have your my_so Object ar _level0 and in the above code your are using _root and _parent. You can try with the same _level0 instead.

Hope this helps and as I said iam not really able to understand your code completly so please excuse me if iam wrong.

Thanks,
KP
0
 

Author Comment

by:WebArchitect_Vince
ID: 10769761
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
0
 
LVL 9

Expert Comment

by:krishnaprathab
ID: 10911022
No Assist :(
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question