i needed to use the pop() so that it takes out the last element in the array (which is located in a comboBox) but this doesn’t work…please help!
p.s. i get no errors and everything else works fine when i run the code and so does the button:
MY CODE:
var barColours:Array = new Array();
barColours = ["red", "green", "blue", "orange", "purple"];
comboBox.dataProvider = new DataProvider(barColours);
comboBox.addEventListener(Event.CHANGE, onChange);
comboBox.x = 670;
comboBox.y = 55;
minus_btn.addEventListener(MouseEvent.CLICK, takeAwayCol);
function takeAwayCol(ev:MouseEvent):void
{
barColours.pop();
}
Modifying the array doesn’t “notify” the list of the change you’ll need to reassign the dataProvider.
EDITED per comment