PDA

View Full Version : combo box- loading swf from choice??


apache13
07-14-2005, 08:14 PM
Hello

I am trying to load a swf from the choices in a combo box. My code below seems to be taking the # of the array rather then the info in "" - Any ideas what I am doing wrong



labelArray = [];
labelArray[0] = "july";
labelArray[1] = "july13";
labelArray[2] = "nov12";

urlArray = [];
urlArray[0] = "july.swf";
urlArray[1] = "july13.swf";
urlArray[2] = "nov12.swf";

myComboBox.dataProvider = labelArray;

myListener = new Object();

myListener.change = function() {
clip.loadMovie ([myComboBox.selectedIndex] );;
};

myComboBox.addEventListener("change", myListener);

sleekdigital
07-14-2005, 10:03 PM
Well yeah... that is what selectedIndex returns.. the index (NUMBER) of the item that is selected. Also, i don't know why you have square braces around that.

I think you want myComboBox.selectedItem

apache13
07-14-2005, 10:25 PM
That did it :)- Thanks