9 Replies Latest reply on Dec 13, 2009 4:27 AM by docko12

    I have problem with selectedItem.data

    docko12

      Hi i have online game and i have to know how to do this easy thing
      i have inventory and under things like first aid is number of objects and its combobox and after change i want to change variable kolko[i] to equals combobox name : "co"+i and that selecteditem data , i have this

       

      if (nodes[i].attributes.typ == "vylepsenie") {
      mport mx.controls.*;
                              createClassObject(ComboBox,"co"+i,_root.getNextHighestDepth(),{_x:_root["madaka"+i]._x, _y:_root["madaka"+i]._y+80});
                              _root["co"+i].rowCount = 2;

       

       

       


                              for (var o = 1; o<=nodes[i].attributes.pocet; o++) {
                                  _root["co"+i].addItem(o,o);
                              }

       

                          } else {
                              kolko[i] = "1";
                          }
                          var listenerObject:Object = new Object();
                          listenerObject.change = function(eventObject:Object) {
                             
                              kolko[i] = _root["co"+i].target.selectedItem.data;
                              _level0.skus = kolko[i];
                          };
                          _root["co"+i].addEventListener("change",listenerObject);
                          if (kolko[i] == undefined) {
                              kolko[i] = 1;
                          }
                          _root["madaka"+i].adresa = nodes[i].attributes.urla+"&pocet="+kolko[i];

       


      _level0.skus is only text which shows me selected number but its always after change show only undefined. THx for help