⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 storeitemcollection.as

📁 This is a Flex UIComponent that can be used 谋n a FLEX 3 mxml application as component written in act
💻 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]);
		}

	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -