Flash MX ComboBox

I want to use the combobox function that MX has, but how do script it?
The one that I’ve got from the help site is quite vague(I guess that is why I spent more time in flashkit and kirupa more than Macromedia site, even the help-forum is not that user friendly{personal commnets}), that is

function onChange(component){
if (componet._name==“check1”){
else_if (componet._name==“check2”){

I would understand that this could be a lenghty subject, maybe somebody could guide me to a place that I could get a tutorial?

What does this have to do with a combobox ?

pom :asian:

By the way, I have a tutorial on the way…

Well I thought that was the code…(duh)

How to code it so that I can use ComboBox? Whats the use of Flash UI components if I cannot even find the correct code to use it? Macromedia site only give gibberish that I do not know which is the code and which is the variables.

ilyaslamasse, can you help me with the codes, I’m using comboBox.

BTW, how’s your class? Hope it does not go as you expected!(tough, I mean)

OK. Just drag a combobox on your scene, and give it the instance name birth. Then in the first FRAME of your movie, put this code :

// populate the combobox
for (i=1970;i<1990;i++) {
	birth.addItem (i) ;
// function to display the selection
function comboDisplay (component) {
	trace ( component.getSelectedItem().label );
// We assign the function to the combobox
birth.setChangeHandler ("comboDisplay") ;

You can also link each label (here a number) to a data, and use that data in the comboDisplay function.

The classes are peachy by the way =) for now…

Cheers! pom :asian:

I have to try it that way. To tell you the truth… the way I have used it is more similar to niisa’s code…

hmm… different ways to use the “force” you have

OK, OK, I wasn’t trying to answer a particular question, but merely trying to give an example of a code that one could put for a Combobox.

Now in the first code, there’s check1, check2 (checkboxes ?), listboxes but no combobox… What are you trying to do exactly, niisa ?

pom :asian:

I have went to more indepth and found the answer that I am looking for, apparently not that easy. The code up there is not what I want to achieve. It is this one…

function getResults() {
var1 = combo_box.getSelectedItem().label;
selectedItem = color_box.getSelectedIndex();
var2 = combo_box.getSelectedItem().data;
selectedItem = color_box.getSelectedIndex();

inwhich var1 is for displayed selection and var2 is for calculation.
BTW anybody knows why you need…

selectedItem = color_box.getSelectedIndex();

in the code