Packagecom.afcomponents.umap.core
Classpublic class MapObjectContainer
InheritanceMapObjectContainer Inheritance MapObject Inheritance flash.display.Sprite
ImplementsIMapObjectContainer
SubclassesControl, Display, GridLayer, Layer, Manager, ManagerControl, TileLayerOverlay

MapObjectConatiner is the base class for the container objects used in the map.

It extends the MapObject class and implements the IMapObjectContainer interface. You can add and remove MapObjects, as whell as list them all, or with a filter. You should never create an instance of this class directly.

See also

com.afcomponents.umap.core.MapObject


Public Properties
 PropertyDefined by
 InheritedasDisplayObject : DisplayObject
Returns reference to the object as a DisplayObject instance.
MapObject
 Inheritedcore : UMap
Returns reference to the core UMap object.
MapObject
 Inheritedid : uint
Gets or sets the ID of the object.
MapObject
 Inheritedname : String
Gets or sets the name of the object.
MapObject
 Inheritedowner : IMapObjectContainer
Returns reference to the owner container object.
MapObject
Public Methods
 MethodDefined by
  
MapObjectContainer(param:Object = null)
MapObjectContainer constructor.
MapObjectContainer
  
addObject(object:IMapObject):void
Adds new IMapObject to the container.
MapObjectContainer
  
bringForward(object:IMapObject):void
Moves the attached IMapObject forward in the display list.
MapObjectContainer
  
bringToFront(object:IMapObject):void
Brings the attached IMapObject to the top of the display list.
MapObjectContainer
  
clearObjects(filter:Class = null):void
Removes all attached objects.
MapObjectContainer
  
dispose():void
Releases all the resources accuired by the object.
MapObjectContainer
  
getObject(id_or_name:*, filter:Class = null):IMapObject
Searches for an object with specified id or name.
MapObjectContainer
  
getObjectById(id:uint, filter:Class = null):IMapObject
Searches for an object with specified id.
MapObjectContainer
  
getObjectByName(name:String, matchCase:Boolean = false, filter:Class = null):IMapObject
Searches for an object with specified name.
MapObjectContainer
  
getObjects(filter:Class = null):Array
Returns an array of IMapObjects that where added to the container.
MapObjectContainer
  
isOwnerVisible():Boolean
Recursevly checks visibility of parent objects
MapObjectContainer
 Inherited
remove():void
Removes the object from the owner container object.
MapObject
  
removeObject(object:IMapObject):void
Removes IMapObject from the container.
MapObjectContainer
  
sendBackward(object:IMapObject):void
Sends the attached IMapObject backward in the display list.
MapObjectContainer
  
sendToBack(object:IMapObject):void
Sends the attached IMapObject to the bottom of the display list.
MapObjectContainer
  
Adds the object to the specified IMapObjectContainer.
MapObjectContainer
 Inherited
toString():String
Returns a textual representation of the object.
MapObject
Constructor detail
MapObjectContainer()constructor
public function MapObjectContainer(param:Object = null)

MapObjectContainer constructor. Creates new container for MapObjects. You can pass MapObjectContainer's name and visibility via param object. ID will be assigned to the object automatically.

Parameters
param:Object (default = null) — that specifies additional properties.
Method detail
addObject()method
public function addObject(object:IMapObject):void

Adds new IMapObject to the container.

Parameters
object:IMapObject — Reference to an object that should be added to the container.
bringForward()method 
public function bringForward(object:IMapObject):void

Moves the attached IMapObject forward in the display list.

Parameters
object:IMapObject — Reference to IMapObject that should be moved forward.
bringToFront()method 
public function bringToFront(object:IMapObject):void

Brings the attached IMapObject to the top of the display list.

Parameters
object:IMapObject — Reference to IMapObject that should be brought to front.
clearObjects()method 
public function clearObjects(filter:Class = null):void

Removes all attached objects. If filter parameter is defined, only removes objects of the specified class.

Parameters
filter:Class (default = null) — Class that should be used as a filter.
dispose()method 
public override function dispose():void

Releases all the resources accuired by the object.

getObject()method 
public function getObject(id_or_name:*, filter:Class = null):IMapObject

Searches for an object with specified id or name. Additionally you can filter objects by it's type. For speed, please consider using getObjectById(), and getObjectByName() methods.

Parameters
id_or_name:* — ID or name of the object. If you pass a Number object will be searched by it's ID. If you pass a String object will be searched by it's name and the letter case will not match.
 
filter:Class (default = null) — Class that should be used as a filter.

Returns
IMapObject — Reference to the found object or null if it was not found.
getObjectById()method 
public function getObjectById(id:uint, filter:Class = null):IMapObject

Searches for an object with specified id. Additionally you can filter objects by it's type.

Parameters
id:uint — ID of the object.
 
filter:Class (default = null) — Class that should be used as a filter.

Returns
IMapObject — Reference to the found object or null if it was not found.
getObjectByName()method 
public function getObjectByName(name:String, matchCase:Boolean = false, filter:Class = null):IMapObject

Searches for an object with specified name. Additionally you can specify whether to match case when searching and you can also filter objects by it's type.

Parameters
name:String — Name of the object.
 
matchCase:Boolean (default = false) — Defines whether to match case when searching.
 
filter:Class (default = null) — Class that should be used as a filter.

Returns
IMapObject — Reference to the found object or null if it was not found.
getObjects()method 
public function getObjects(filter:Class = null):Array

Returns an array of IMapObjects that where added to the container. Additionally you can specify a class name to return only the objects of that class.

Parameters
filter:Class (default = null) — Name of the class that should be used as a filter.

Returns
Array — An Array holding all the attached objects.
isOwnerVisible()method 
public function isOwnerVisible():Boolean

Recursevly checks visibility of parent objects

Returns
Boolean
removeObject()method 
public function removeObject(object:IMapObject):void

Removes IMapObject from the container.

Parameters
object:IMapObject — Reference to an object that should be removed from the container.
sendBackward()method 
public function sendBackward(object:IMapObject):void

Sends the attached IMapObject backward in the display list.

Parameters
object:IMapObject — Reference to IMapObject that should be sent backward.
sendToBack()method 
public function sendToBack(object:IMapObject):void

Sends the attached IMapObject to the bottom of the display list.

Parameters
object:IMapObject — Reference to IMapObject that should be sent to back.
setOwner()method 
public override function setOwner(owner:IMapObjectContainer):void

Adds the object to the specified IMapObjectContainer.

If the object was previosly attached to a container, object will be removed from it. If you specify null instead of the owner, IllegalOperationError will be thrown.

Parameters
owner:IMapObjectContainer — New owner of the object.