# Component question

**URL:** <https://forum.kirupa.com/t/component-question/6512>\
**Category:** flash\
**Created:** [October 9, 2002, 11:13am UTC](https://forum.kirupa.com/t/component-question/6512 "2002-10-09T11:13:21Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sevensleeper](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@sevensleeper](https://forum.kirupa.com/u/sevensleeper)\
**Post date:** [October 9, 2002, 11:13am UTC](https://forum.kirupa.com/t/component-question/6512/1 "2002-10-09T11:13:21Z")

</div>

Hi Everyone.  
Just had a question. Is ist possible for a listobx item to execute more than one function. For example, have a listbox item load a jpg, load some data into a text and maybe be crazy and setProperty of a specific object. What would the code look like. Is it possible to do it like the kirupa’s listbox tutorial? I’ve tried but no luck.

any takers. j

p.s. I really like this forum and this site. I just started learing Flash MX two weeks ago and I found great tutorials and great advice. Just wanted to say thanks.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 3:01pm UTC](https://forum.kirupa.com/t/component-question/6512/2 "2002-10-09T15:01:47Z")

</div>

you can run as many commands as you like

in the properties of the listbox component choose a name for your change handler (the code to execute when something changes in your listbox). I make most of mine “onChange”…

in a frame on my main timeline, I add some actionscript that looks something like this:

```auto

onChange=function(flistbox){
do this;
do that;
do the other; // just keep adding until you're done

}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 4:09pm UTC](https://forum.kirupa.com/t/component-question/6512/3 "2002-10-09T16:09:05Z")

</div>

Sorry But I’m still a little confused. How do I specify each listbox item.

I have about a hundred names I need to add to a listbox. Each name corosponds with a picture, some data and certain place on a map.

Right now I was using POM told me about and works great:

list.addItem(“them”,new Array(“movie5.swf”));

function loadMyMovie©{  
var j = c.getSelectedItem().data;  
loadMovieNum(j,1);  
}

list.setChangeHandler(“loadMyMovie”)

But can I add more to this like load data and stuff? Please let me know. J

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 4:28pm UTC](https://forum.kirupa.com/t/component-question/6512/4 "2002-10-09T16:28:25Z")

</div>

Well yes, you can put other things in there. For instance, if you want to load the movie and then go somewhere in the main movie:

```auto
list.addItem("them",new Array("movie5.swf",5));

function loadMyMovie(c){
	var j = c.getSelectedItem().data[0];
	var k = c.getSelectedItem().data[1];
	loadMovieNum(j,1);
	_root.gotoAndPlay(k);
}

list.setChangeHandler("loadMyMovie")

```

pom :cowboy:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 5:56pm UTC](https://forum.kirupa.com/t/component-question/6512/5 "2002-10-09T17:56:54Z")

</div>

dude, thank you so much. That worked miracles. Sweet. Now I have to add hundred names. thanks j

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 6:16pm UTC](https://forum.kirupa.com/t/component-question/6512/6 "2002-10-09T18:16:40Z")

</div>

:cowboy:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 6:45pm UTC](https://forum.kirupa.com/t/component-question/6512/7 "2002-10-09T18:45:52Z")

</div>

Pom has this nasty habit of beating me to the answers…hehehe… That’s why he uses the cowboy smilies…fastest draw on the net. Whew… that was a lame joke…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 8:47pm UTC](https://forum.kirupa.com/t/component-question/6512/8 "2002-10-09T20:47:07Z")

</div>

thanks guys. you make it eassier to learn this program. I’ll probably be back for more question. Look out. j

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 8:50pm UTC](https://forum.kirupa.com/t/component-question/6512/9 "2002-10-09T20:50:22Z")

</div>

[John Wayne accent]Inigo… 😛 I’m glad you’re back. I was beginning to miss that will-I-post-before-him feeling…

Cheers![/John Wayne accent]

pom :cowboy:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 8:55pm UTC](https://forum.kirupa.com/t/component-question/6512/10 "2002-10-09T20:55:33Z")

</div>

“Why, Johnny Ringo, you look like someone just walked over your grave”-Doc Holliday, movie Tombstone

Yah… feels good to be back. I mean, I was posting around, but I was leaving the actual questions to other people. 🙂

Yeehaw…
