Hello. I have this function:
function addItem(bkItem):Void {
_aProducts.push(bkItem);
dispatchEvent({type: “update”, target: this});
var list:MovieClip = createEmptyMovieClip(“list_mc”, 25);
var listText:TextField = list.createTextField(“list_txt”, 26, 0, 0, 150, 350);
var numar:TextField = list.createTextField(“numar_txt”, 30, 30, 40, 50, 50);
numar.type = “input”;
listText.selectable = false;
list._x = 680;
list._y = 440;
var i;
var cont = 0;
for (i = 0; i < _aProducts.length; i++) {
listText.text += _aProducts* + "
";
if (_aProducts* == listText.text) {
cont++;
trace(cont);
}
}
numar.text = i;
}
I press a button and display what I press. If I press more then once on a product I what to initialize a cont and to display the product+the number of presses else to display the list.
My problem is that if doesn’t do this part:
if (_aProducts* == listText.text) ??
Thank you.