Solved

Getting Object Info

Posted on 2004-03-25
4
153 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
  • 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 500 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
FLV versus SWF 11 263
Add 'birds singing' to homepage 5 91
Firefox fullscreen video lags 4 147
IE11 stops playing video on a certain website 10 55
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
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): …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now