Roland
New Member
- Joined
- Aug 8, 2009
- Messages
- 6
- Reaction score
- 0
- Points
- 1
This is a function who is supposed to remove an item from the store item.
I can't understand it. All I know from this function is that it wants to
remove only one item(_collection.splice(i, 1) when it founds and
and the loops stops when he got the item to remove(break)
The all class was an Arry Class and there was an AddItem function
which I understand without any issue.
Public function removeItem(item:StoreItem): void {
var i:uint;
for( i = 0; i < _collection.length; i++) {
if (collection == item) {
_collection.splice(i, 1);
break;
}
}
(This an AS3 Function for beginner)
I can't understand it. All I know from this function is that it wants to
remove only one item(_collection.splice(i, 1) when it founds and
and the loops stops when he got the item to remove(break)
The all class was an Arry Class and there was an AddItem function
which I understand without any issue.
Public function removeItem(item:StoreItem): void {
var i:uint;
for( i = 0; i < _collection.length; i++) {
if (collection == item) {
_collection.splice(i, 1);
break;
}
}
(This an AS3 Function for beginner)