0

I have a list of 2 items with their respective values. I would like to click on a button and have it deselect the previously selected item.

var lista:List = new List();
lista.setSize(100,45);
lista.x = 348;
lista.y = 420;
lista.addItem({label: "Negative feelings",valor:1});
lista.addItem({label: "Positive feelings",valor:2});
addChild(lista);

VC.One
  • 14,790
  • 4
  • 25
  • 57
  • lista.clearSelection() https://help.adobe.com/es_ES/FlashPlatform/reference/actionscript/3/fl/controls/SelectableList.html#clearSelection() – Rodrigo Gutierrez Jun 27 '20 at 05:22
  • What is your exact question? Do you want _"select by default"_ (auto-selected at starting of your app) or you want _"deselect the previously selected item"_? Also how do you know the previous item is not de-selected? Did you check index of currently selected item (maybe it changed to the new item)? PS: Your code is not enough to recreate your problem. If you want help then show us how to see the same problem by running code or show link to web page with example of problem. – VC.One Jun 27 '20 at 23:44
  • PPS: Did you use a DataProvider? Did you add Mouse event listener for clicks? – VC.One Jun 27 '20 at 23:47

0 Answers0