PDA

View Full Version : How do you make a comboBox item sticky?


allenshorter
02-02-2005, 06:32 PM
So I have a comboBox with the values 50, 100, 200, 300, 400, and 500. When the scene first pops up 50, being the first value, pops up. Then I choose 300, it sets a variable. I go to the next screen and if I come back...50 is selected again (even though my variable is still set to 300...unless you change this again). What I want is for when the user comes back, it will show what they selected previously...based on what the variable was set to.

In other words, I need to program something the equivalent of the SELECTED function on a pulldown menu in HTML. Has anyone done this, can they help me out? How do I program a comboBox to automatically pop up with a selected item that is not the first one in the list?

I am making an application in Macromedia MX 2004 that is going to be exported to macromedia 6 swf, so the solution I am looking for has to work with that.

A big :D to anyone who can help me out here.

Xeef
02-02-2005, 06:38 PM
hi and welcome to As.Org

"selectedIndex" shoud by your friend

allenshorter
02-02-2005, 07:14 PM
Could you maybe tell me what I need to do to use that function. Like if I want to select the third item, what would I say? if you could be a little more specific, I would be greatful.

Xeef
02-02-2005, 07:21 PM
:)


instance_name_of_my_combobox.selectedIndex=2 //NOT 3 because is "0" based
eg first element =0