Packageorg.fluint.uiImpersonation.flex
Classpublic class FlexSparkVisualTestEnvironment
InheritanceFlexSparkVisualTestEnvironment Inheritance FlexMXVisualTestEnvironment Inheritance VisualTestEnvironment Inheritance Object

Builds a visual test environment for Flex 4.0 and above projects



Public Properties
 PropertyDefined By
 InheritednumChildren : int
[read-only] Returns the number of children currently in the test environment
VisualTestEnvironment
 InheritedtestEnvironment : Sprite
[read-only] Returns the sprite which contains all children added to the test environment.
VisualTestEnvironment
Public Methods
 MethodDefined By
  
Constructor Creates a new test environment using the baseClass as a base.
FlexSparkVisualTestEnvironment
 Inherited
addChild(child:DisplayObject):DisplayObject
Add a child to test environment.
VisualTestEnvironment
 Inherited
addChildAt(child:DisplayObject, index:int):DisplayObject
Add a display object at the specified index.
VisualTestEnvironment
  
addElement(element:DisplayObject):DisplayObject
[override] Adds a visual element to the test environment.
FlexSparkVisualTestEnvironment
  
addElementAt(element:DisplayObject, index:int):DisplayObject
[override] Adds a visual element at the specified index.
FlexSparkVisualTestEnvironment
 Inherited
getChildAt(index:int):DisplayObject
Retrieves the child at the specified index without removing the child.
VisualTestEnvironment
 Inherited
getChildByName(name:String):DisplayObject
Retrieves the child with the specified name without removing the child\
VisualTestEnvironment
 Inherited
getChildIndex(child:DisplayObject):int
Retrieves the index of the specified child in the test environment
VisualTestEnvironment
  
getElementAt(index:int):DisplayObject
[override] Returns the visual element at the specified index without removing the element
FlexSparkVisualTestEnvironment
  
getElementIndex(element:DisplayObject):int
[override] Retrieves the index of the specified visual element.
FlexSparkVisualTestEnvironment
 Inherited
Removes all children currently in the test environment
VisualTestEnvironment
  
[override] Removes all elements from the test environment.
FlexSparkVisualTestEnvironment
 Inherited
removeChild(child:DisplayObject):DisplayObject
Removes the specified child from the test environment.
VisualTestEnvironment
 Inherited
removeChildAt(index:int):DisplayObject
Removes a child at the specified index.
VisualTestEnvironment
  
removeElement(element:DisplayObject):DisplayObject
[override] Remove the specified visual element from the test environment.
FlexSparkVisualTestEnvironment
  
removeElementAt(index:int):DisplayObject
[override] Removes the visual element at the specified index, returning a reference to the removed element.
FlexSparkVisualTestEnvironment
 Inherited
setChildIndex(child:DisplayObject, newIndex:int):void
Updates the specified child to the new index.
VisualTestEnvironment
  
setElementIndex(element:DisplayObject, index:int):void
[override] Changes the position of the specified element to the new index.
FlexSparkVisualTestEnvironment
Constructor Detail
FlexSparkVisualTestEnvironment()Constructor
public function FlexSparkVisualTestEnvironment(baseClass:Class)

Constructor

Creates a new test environment using the baseClass as a base. This base needs to be a container that implements IVisualElementContainer.

Parameters
baseClass:Class — A class reference to the container the environment should be built from.
Method Detail
addElement()method
override public function addElement(element:DisplayObject):DisplayObject

Adds a visual element to the test environment. Although this method takes a DisplayObject, the display object must implement the IVisualElement interface.

Parameters

element:DisplayObject — visual element to add

Returns
DisplayObject — A reference to the visual element
addElementAt()method 
override public function addElementAt(element:DisplayObject, index:int):DisplayObject

Adds a visual element at the specified index. Any elements at or above this index will be shifted up to accomodate. Although this method takes a DisplayObject, the display object must implement the IVisualElement interface.

Parameters

element:DisplayObject — visual element to add
 
index:int — index to insert the element

Returns
DisplayObject — a reference to the added element
getElementAt()method 
override public function getElementAt(index:int):DisplayObject

Returns the visual element at the specified index without removing the element

Parameters

index:int — location of visual element to retrieve

Returns
DisplayObject — reference to the requested element
getElementIndex()method 
override public function getElementIndex(element:DisplayObject):int

Retrieves the index of the specified visual element.

Parameters

element:DisplayObject — reference to the element

Returns
int — location of the element
removeAllElements()method 
override public function removeAllElements():void

Removes all elements from the test environment.

removeElement()method 
override public function removeElement(element:DisplayObject):DisplayObject

Remove the specified visual element from the test environment. Although this method takes a DisplayObject, the display object must implement the IVisualElement interface.

Parameters

element:DisplayObject — visual element to remove

Returns
DisplayObject — a reference to the removed element
removeElementAt()method 
override public function removeElementAt(index:int):DisplayObject

Removes the visual element at the specified index, returning a reference to the removed element.

Parameters

index:int — location of element to remove

Returns
DisplayObject — reference to removed element
setElementIndex()method 
override public function setElementIndex(element:DisplayObject, index:int):void

Changes the position of the specified element to the new index. Although this method takes a DisplayObject, the display object must implement the IVisualElement interface.

Parameters

element:DisplayObject — visual element to change
 
index:int — new index of the element