Solved

Getting Object Info

Posted on 2004-03-25
4
158 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
playing flash video on kiosk at startup 6 411
Action Script commands 5 241
Flash player 17 install script .bat or .vbs 9 560
Online Course Not Responding 3 96
I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
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 the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

860 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