| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
A
Locator is an entity that points to specific kind
of ressources within an application. All ressources stored by a
locator is identified with a unique key.
All concret locators implementations are associated with a specific
types of ressources. For example, the GraphicLoaderLocator
allow a single access point for all swf files loaded
by an application.
public function add(d:Dictionary):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Adds all ressources contained in the passed-in dictionnary
into this locator instance. If there is keys used both in
the locator and in the dictionnary an exception is thrown.
Parameters
| d:Dictionary — dictionnary instance which contains ressources
to be added
|
Throws
| — IllegalArgumentException — One or more
keys present in the dictionnary already exist in this
locator instance.
|
public function getKeys():Array
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns an Array view of the keys contained in this locator.
Returns
| Array — an array view of the keys contained in this locator
|
public function getValues():Array
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns an Array view of the values contained in this locator.
Returns
| Array — an array view of the values contained in this locator
|
public function isRegistered(key:String):Boolean
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns true is there is a ressource associated
with the passed-in key. To avoid errors when
retreiving ressources from a locator you should systematically
use the isRegistered function to check if the
ressource you would access is already accessible before any
call to the locate function.
Parameters
Returns
| Boolean — true is there is a ressource associated
with the passed-in key.
|
public function locate(key:String):Object
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns the ressource associated with the passed-in key.
If there is no ressource identified by the passed-in key, the
function will fail with an error. To avoid the throw of an exception
when attempting to access to a ressource, take care to check the
existence of the ressource before trying to access to it.
Parameters
| key:String — identifier of the ressource to access
|
Returns
| Object — the ressource associated with the passed-in key
|
Throws
| — NoSuchElementException — There is no ressource
associated with the passed-in key
|
LowRA API documentation 2008- 2009
Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1
mer. févr. 25 2009, 9:22 AM GMT+01:00