|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problems selecting ComboBox value dynamically
Hello,
Filling a ComboBox dynamically with values of countries, using a numerical country code, from a text file. That all works fine. Problem is, cant get the combobox to jump to the right value (determined via MySQL & PHP). While PHP definitely passes the country code correctly to Flash, the Combobox wont budge in what its displaying. In fact, hardcoding an index does not work either, although similar code works fine and I do seem to be targetting correctly. Here´s the parts of my code I think the problem must be in after some debugging. Does anyone know if filling the combo dynamically messes with the numerical index? // dynamically create entries for // combobox...works. label is the name of // the country, data an index running // 0 - 190 this.ondata = function(){ for (i=0; i<191; i++) { // create a real item var myItem = new Object(); myItem.label = eval(this.i); myItem.data = i; // put it in the array countries[i] = myItem; } // fill the combo box country.setDataProvider(countries); } /* dynamically select entry, doesnt work. Country is instance of combobox in one case, and country code variable in the other. This is instantiated correctly by PHP */ _root.movie_mc.main_mc.edit_mc.country.setSelectedIndex(_root.movie_mc.main_mc.data_mc.country); // hard-coding it doesn´t work either _root.movie_mc.main_mc.edit_mc.country.setSelectedIndex(190); Anyone see a problem with the code or got something similar to work? |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Problems selecting ComboBox value dynamically |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|