PDA

View Full Version : Combobox gallery help?


JRedd
08-22-2005, 05:05 PM
Alright I'm extremely new at using flash but do now have a basic grasp and will appreciate any help you can give me. :D

I have been challenged with creating a flash document for a site which displays jpg/bmp files of survey data. Basically the document is full of about 30 pictures that need to be displayed at the will of the user through the dropdown list. Currently each pictures makes up a frame which are listed in order to the corresponding number in the dropdown list, so slot 1 of the dropdown points to the first frame displaying the image, 2 includes the second and so on displaying them that way.

function change(evt){
var yearFrame = (evt.target.selectedIndex);
if (yearFrame>0)
{
gotoAndStop(yearFrame);
}

}
comboBox.addEventListener("change", this);

I need to add a seperate dropdown to display a few different images in another category. In trying to use this same method I realized that I would have to have 20 blank spaces at the beginning of the drop down because it would point to the other category's images.

Now i'm wondering if there is some way to omit blank slots in the combobox and start at say slot 25 in the combobox? Or is there some other way I should go about this?

Neil Davidson
08-30-2005, 06:36 PM
a combo box is, in essence, a method of displaying an array of items. Each item has an index number that can be referenced, starting from 0. So if you have 25 items, you can reference any one of them from numbers 0-24.

sfhazel
08-30-2005, 07:02 PM
a combo box is, in essence, a method of displaying an array of items. Each item has an index number that can be referenced, starting from 0. So if you have 25 items, you can reference any one of them from numbers 0-24.

That is what JRedd is referencing in his code. I think the problem is that JRedd is using this index number as a reference to a frame that contains the information for each item in the list. So, when making a second dropdown list, the items start over again at 0 and start linking to frames that already have content.

If there is a way to count the number of items in your first dropdown menu, then you can make a second function, that adds this number to the index number of each item when it links to a frame.