Skip to main content
November 11, 2008
Question

Help using list component

  • November 11, 2008
  • 1 reply
  • 320 views
My goal is to have a flash projector file that displays a list, and when you click on an item, it runs the corresponding .exe file. I am using Flash CS4, and I don't have much experience when it comes to using components. How do you populate the list? Can I use an XML file? How do you assign a function to each item in the list?

Thanks,
gambrker
This topic has been closed for replies.

1 reply

Ned Murphy
Legend
November 11, 2008
There are a number of ways to populate a List component, but from what I can see they all boil down to feeding in label/data sets.

You can find various approaches in the Flash documentation... search in the AS3 Components section for Using the List. You should find all you need to know from those examples.

You can use an XML file to fill up an array (or two), so long as you capture the data from it as label and data entities. Then you loop thru the array(s) using the List.addItem() method to populate the List. If you used a single array holding {label: ..., data:...} objects, you could use List.dataProvider to load up the List.

To assign functions based on selections, my approach would be to use the change handler function, maybe with some form of switch coding in it to designate an associated external function gets called based on the selection made.

Even if you're able to get something working from what I offered, come back and check for other responses. Someone more knowledgeable than me may provide some good info that saves you some coding.