Skip navigation
Currently Being Moderated

flex 4.6 mobile...problem with cicle for.....

Jan 19, 2013 12:36 AM

Hello everyone!
I have a small problem with respect to a multi-selection of a list with a TextInput .... this is the code:

private function createNewPlayList():void{

                                        for (var i:int = 0; i < list2.selectedItems.length; i++){

                                                  var stat:SQLStatement = new SQLStatement();

                                                  stat.sqlConnection = connection;

                                                  stat.text = "INSERT INTO playlist (nome, canzone, lista) VALUES (@nome, @canzone, @lista)";

                                                  stat.parameters["@nome"] = list2.selectedItems[i].nome;

                                                  stat.parameters["@canzone"] = list2.selectedItems[i].base;

                                                  stat.parameters["@lista"] = txtPlayList.text;

                                                  stat.execute(-1, new Responder(selectItemsPlayList));

                                                  txtErrore2.text="Base e Testo Inseriti nel Database";

                                                  txtPlayList.text= "";

                                        }

}

txtPlayList is name of playlist and is "one TextInput"
Basically, with this script I do a multiselect list (and up here all ok) but what about the column "list" me only adds to the last selected list ... how do I add a lot of "list" how many are selected? ?

I hope I was clear ....

 

help me please....

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points