Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Getting Object Info

Posted on 2004-03-25
4
Medium Priority
?
163 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

971 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