套件 | spark.core |
類別 | public class ContentCache |
繼承 | ContentCache EventDispatcher Object |
實作 | IContentLoader |
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 1.5 |
屬性 | 定義自 | ||
---|---|---|---|
constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | Object | ||
enableCaching : Boolean
Enables caching behavior and functionality. | ContentCache | ||
enableQueueing : Boolean
Enables queuing behavior and functionality. | ContentCache | ||
maxActiveRequests : int
Maximum simultaneous active requests when queuing is
enabled. | ContentCache | ||
maxCacheEntries : int
Maximum size of MRU based cache. | ContentCache | ||
numCacheEntries : int [唯讀]
Count of active/in-use cache entries. | ContentCache |
屬性 | 定義自 | ||
---|---|---|---|
activeRequests : LinkedList
List of queued CacheEntryNode instances currently executing. | ContentCache | ||
cachedData : Dictionary
Map of source to CacheEntryNode. | ContentCache | ||
cacheEntries : LinkedList
Ordered (MRU) list of CacheEntryNode instances. | ContentCache | ||
priorityGroup : String = "_DEFAULT_"
Identifier of the currently prioritized content grouping. | ContentCache | ||
requestQueue : LinkedList
List of queued CacheEntryNode instances. | ContentCache |
方法 | 定義自 | ||
---|---|---|---|
Constructor. | ContentCache | ||
Adds new entry to cache (or replaces existing entry). | ContentCache | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
會在 EventDispatcher 物件註冊事件偵聽程式,以便讓偵聽程式收到事件的通知。 | EventDispatcher | ||
會將事件傳送到事件流程。 | EventDispatcher | ||
Obtain an entry for the given key if one exists. | ContentCache | ||
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。 | EventDispatcher | ||
指出物件是否有已定義的指定屬性。 | Object | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
Initiates a content request for the resource identified
by the key specified. | ContentCache | ||
Promotes a content grouping to the head of the loading queue. | ContentCache | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
Resets our cache content to initial empty state. | ContentCache | ||
Resets the queue to initial empty state. | ContentCache | ||
Remove specific entry from cache. | ContentCache | ||
會從 EventDispatcher 物件移除偵聽程式。 | EventDispatcher | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
會傳回指定之物件的基本值。 | Object | ||
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。 | EventDispatcher |
事件 | 摘要 | 定義自 | ||
---|---|---|---|---|
[廣播事件] 當 Flash Player 或 AIR 應用程式取得作業系統焦點並成為作用中時傳送。 | EventDispatcher | |||
[廣播事件] 當 Flash Player 或 AIR 應用程式失去作業系統焦點並成為非作用中時傳送。 | EventDispatcher | |||
Dispatched when a cache entry is invalidated, generally this occurs when the entry is determined to be untrusted while one or more outstanding load requests are active for a given cache entry. | ContentCache |
常數 | 定義自 | ||
---|---|---|---|
UNTRUSTED : String = "untrusted" [靜態]
Value used to mark cached URLs that are detected as being from an
untrusted source (meaning they will no longer be shareable). | ContentCache |
activeRequests | 屬性 |
protected var activeRequests:LinkedList
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 1.5 |
List of queued CacheEntryNode instances currently executing.
cachedData | 屬性 |
protected var cachedData:Dictionary
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Map of source to CacheEntryNode.
cacheEntries | 屬性 |
protected var cacheEntries:LinkedList
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Ordered (MRU) list of CacheEntryNode instances.
enableCaching | 屬性 |
enableQueueing | 屬性 |
maxActiveRequests | 屬性 |
maxCacheEntries | 屬性 |
maxCacheEntries:int
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Maximum size of MRU based cache. When numCacheEntries exceeds maxCacheEntries the least recently used are pruned to fit.
預設值為 100。
實作
public function get maxCacheEntries():int
public function set maxCacheEntries(value:int):void
numCacheEntries | 屬性 |
priorityGroup | 屬性 |
protected var priorityGroup:String = "_DEFAULT_"
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Identifier of the currently prioritized content grouping.
預設值為 "_DEFAULT_"。
requestQueue | 屬性 |
protected var requestQueue:LinkedList
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 1.5 |
List of queued CacheEntryNode instances.
ContentCache | () | 建構函式 |
public function ContentCache()
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Constructor.
addCacheEntry | () | 方法 |
public function addCacheEntry(source:Object, value:Object):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Adds new entry to cache (or replaces existing entry).
參數
source:Object — Unique key to associate provided value with in cache.
| |
value:Object — Value to cache for given key.
|
getCacheEntry | () | 方法 |
public function getCacheEntry(source:Object):Object
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Obtain an entry for the given key if one exists.
參數
source:Object — Unique key used to represent the requested content resource.
|
Object — A value being stored by the cache for the provided key. Returns
null if not found or in the likely case the value was stored as null.
|
load | () | 方法 |
public function load(source:Object, contentLoaderGrouping:String = null):ContentRequest
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 2.5 |
Initiates a content request for the resource identified by the key specified.
參數
source:Object — Unique key used to represent the requested content resource.
This parameter is typically an URL or URLRequest.
| |
contentLoaderGrouping:String (default = null ) — - (Optional) grouping identifier for the loaded resource.
ContentLoader instances supporting content groups generally allow for
resources within the same named grouping to be addressed as a whole. For
example the ContentCache's loader queue allows requests to be prioritized
by contentLoaderGrouping.
|
ContentRequest — A ContentRequest instance representing the requested resource.
|
prioritize | () | 方法 |
public function prioritize(contentLoaderGrouping:String):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Promotes a content grouping to the head of the loading queue.
參數
contentLoaderGrouping:String — Name of content grouping to promote
in the loading queue. All queued requests with matching
contentLoaderGroup will be shifted to the head of the queue.
|
removeAllCacheEntries | () | 方法 |
public function removeAllCacheEntries():void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Resets our cache content to initial empty state.
removeAllQueueEntries | () | 方法 |
public function removeAllQueueEntries():void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Resets the queue to initial empty state. All requests, both active and queued, are cancelled. All cache entries associated with canceled requests are invalidated.
removeCacheEntry | () | 方法 |
invalidateLoader | 事件 |
spark.events.LoaderInvalidationEvent
屬性 LoaderInvalidationEvent.type =
spark.events.LoaderInvalidationEvent
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 2.0 |
Dispatched when a cache entry is invalidated, generally this occurs when the entry is determined to be untrusted while one or more outstanding load requests are active for a given cache entry. This mechanism allows any outstanding content requests to be reset due to the fact that the cache entry has been deemed 'unshareable'. Each content request notified then attempts instead re-requests the asset.
UNTRUSTED | 常數 |
protected static const UNTRUSTED:String = "untrusted"
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Value used to mark cached URLs that are detected as being from an untrusted source (meaning they will no longer be shareable).
Tue Jun 12 2018, 03:47 PM Z