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.
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:
onChange=function(flistbox){
do this;
do that;
do the other; // just keep adding until you're done
}
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:
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 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…