?? storeitemcollection.as
字號:
package mx.item.collection
{
import flash.events.Event;
import flash.events.EventDispatcher;
import mx.item.data.StoreItem;
public class StoreItemCollection extends EventDispatcher
{
private var _collection:Array;
public function get count():uint {
return _collection.length;
}
public function StoreItemCollection()
{
_collection = new Array();
}
public function addItem(item:StoreItem):void {
_collection.push(item);
item.collection = this;
dispatchEvent(new Event(Event.CHANGE));
}
public function removeItem(item:StoreItem):void {
var i:uint;
for(i = 0; i <_collection.length; i++) {
if(_collection[i] == item) {
_collection.splice(i,1);
break; // Break For Dongusunu Term?nate Ed?cekt?r
}
}
dispatchEvent(new Event(Event.CHANGE));
}
public function getItem(index:uint):StoreItem {
return StoreItem(_collection[index]);
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -