Packagecom.gestureworks.cml.elements
Classpublic class Magnifier
InheritanceMagnifier Inheritance TouchContainer Inheritance com.gestureworks.core.TouchSprite

The Magnifier element provides a touch enabled element with an optional graphical lens that will increase the magnification when placed over any display object on the stage.

Note that if the stage does not have a background image or display object of some sort, the MagnifierElement will simply retain visual data from the last object it was held over until brought to another display object.

The MagnifierElement has an optional fish-eye effect that can be altered using distortionRadius. The magnifier has two optional graphics, or can be left on its own with "default", "notch", or "none".

Rotation gestures on the magnifier will zoom it in.

     
        var magnifier:Magnifier = new Magnifier();
        magnifier.x = 550;
        magnifier.y = 150;
        magnifier.radius = 100;
        magnifier.magnification = 2;
        magnifier.distortionRadius = 40;
        magnifier.graphic = "default";
        
        addChild(magnifier);
        
        magnifier.init();
     
     



Public Properties
 PropertyDefined By
 InheritedautoShuffle : Boolean
autoshuffles
TouchContainer
  backgroundBitmapData : BitmapData
Magnifier
 InheritedchildList : ChildList
Returns the object's childList.
TouchContainer
 InheritedclassName : String
sets the class name of displayobject
TouchContainer
 InheritedcloneExclusions : Vector.<String>
[read-only] Returns a list of properties to exclude when cloning this object
TouchContainer
 InheritedcmlIndex : int
Returns the index created by the CML parser.
TouchContainer
 InheriteddimensionsTo : Object
Sets the dimensions of TouchContainer to given object
TouchContainer
  distortionRadius : Number
Set the amount of distortion or "fish-eye" effect the lens goes through before focusing cleanly.
Magnifier
 InheriteddropShadow : Boolean
Sets the drop shadow effect
TouchContainer
  graphic : String
Sets the graphic type: default, notch, or none.
Magnifier
 Inheritedgroup : String
TouchContainer
 Inheritedheight : Number
[override] sets the height of the container
TouchContainer
 InheritedheightPercent : Number
sets the height of the container
TouchContainer
 Inheritedid : String
Returns the object's id.
TouchContainer
 Inheritedlayout : *
specifies the type of layout
TouchContainer
 InheritedlayoutList : Dictionary
TouchContainer
  magnification : Number
The value of magnification of the lens, this can be increased or decreasted by performing a rotation gesture on the lens, and its starting value can be set in CML.
Magnifier
  maxObjectScale : Number
[read-only]
Magnifier
 InheritedmouseChildren : Boolean
[override] sets the mousechildren value to true or false.
TouchContainer
 InheritedpaddingBottom : Number
Sets the number of pixels between the container's bottom border and the bottom of its content area.
TouchContainer
 InheritedpaddingLeft : Number
Sets the number of pixels between the component's left border and the left edge of its content area.
TouchContainer
 InheritedpaddingRight : Number
Sets the number of pixels between the component's right border and the right edge of its content area.
TouchContainer
 InheritedpaddingTop : Number
Sets the number of pixels between the container's top border and the top of its content area.
TouchContainer
 Inheritedposition : *
Sets the position
TouchContainer
  radius : Number
Radius of the total area of the lens, including distortion effects if any.
Magnifier
 InheritedrelativeX : Boolean
When set true this containers children's x position will be laid out relatively to each other.
TouchContainer
 InheritedrelativeY : Boolean
When set true this containers children's y position will be laid out relatively to each other.
TouchContainer
 Inheritedsound : String
TouchContainer
 Inheritedstate : Dictionary
TouchContainer
 InheritedstateId : *
Returns the current state id.
TouchContainer
 InheritedtoBitmap : Boolean
TouchContainer
 Inheritedwidth : Number
[override] sets the width of the container
TouchContainer
 InheritedwidthPercent : Number
sets the width of the container
TouchContainer
  zoomMax : Number
The maximum zoom out value.
Magnifier
  zoomMin : Number
The minimum zoom in value.
Magnifier
  zoomRotateFactor : Number
Sets how fast rotating zooms in.
Magnifier
Protected Properties
 PropertyDefined By
 InheritedcmlGestureList : Object
TouchContainer
Public Methods
 MethodDefined By
  
Constructor
Magnifier
 Inherited
TouchContainer
 Inherited
method searches the child and adds to the list
TouchContainer
 Inherited
addChild(child:DisplayObject):DisplayObject
[override] Adds child to display list and, if not already added, the child list
TouchContainer
 Inherited
addChildAt(child:DisplayObject, index:int):DisplayObject
[override] Adds child to display list and, if not already added, the child list
TouchContainer
 Inherited
applyLayout(value:* = null):void
Apply the containers layout
TouchContainer
 Inherited
childToList(id:String, child:*):void
child appended to the childlist
TouchContainer
 Inherited
clone():*
Clone method
TouchContainer
  
dispose():void
[override] Destructor
Magnifier
 Inherited
getElementById(id:String):*
Searches CML childList by id.
TouchContainer
 Inherited
getElementsByClassName(className:String):Array
Searches the CML childList by className.
TouchContainer
 Inherited
getElementsByTagName(tagName:Class):Array
Searches the CML childList by tagName as Class.
TouchContainer
  
init():void
[override]
Magnifier
 Inherited
loadState(sId:* = null, recursion:Boolean = false):void
Loads state by index number.
TouchContainer
 Inherited
makeGestureList(value:XMLList):Object
Creates gestureList object from XML
TouchContainer
 Inherited
parseCML(cml:XMLList):XMLList
Parse cml for local layouts.
TouchContainer
 Inherited
postparseCML(cml:XMLList):void
Abstract method allows the setting of a postparse CML routine.
TouchContainer
 Inherited
querySelector(selector:String):*
Searches the CML childList by selector.
TouchContainer
 Inherited
querySelectorAll(selector:*):Array
Search the CML childList by selector.
TouchContainer
 Inherited
removeChild(child:DisplayObject):DisplayObject
[override] Removes child from display list and, if not already removed, the child list
TouchContainer
 Inherited
removeChildAt(index:int):DisplayObject
[override] Removes child from display list and, if not already removed, the child list
TouchContainer
 Inherited
removeChildren(beginIndex:int = 0, endIndex:int = 2147483647):void
[override] Removes children from display list and, if not already removed, the child list
TouchContainer
 Inherited
saveState(sId:* = null, recursion:Boolean = false):void
Save state by index number.
TouchContainer
 Inherited
searchChildren(value:*, returnType:Class = null):*
This method does a depth first search of childLists.
TouchContainer
 Inherited
method sets the dimensions of each child
TouchContainer
 Inherited
tweenState(sId:* = null, tweenTime:Number = 1):void
Tween state by stateIndex from current to given state index.
TouchContainer
  
Magnifier
 Inherited
Updates child padding within this container
TouchContainer
 Inherited
Updates child percent dimensions within this container
TouchContainer
 Inherited
updateProperties(state:* = 0):void
Updates properties from state.
TouchContainer
 Inherited
Updates child relative positions within this container
TouchContainer
Property Detail
backgroundBitmapDataproperty
public var backgroundBitmapData:BitmapData

distortionRadiusproperty 
distortionRadius:Number

Set the amount of distortion or "fish-eye" effect the lens goes through before focusing cleanly. This amount is subtracted from the radius to create the focal area, so if the radius is 100, and the distortionRadius is 30, then the "focused" area will have a radius of 70. If the distortion and radius are equal, there will be no in-focus area. The maximum is whatever the radius is, the minimum is 0. Setting a graphic will hide the distortion unless it is made fairly large.

The default value is 30.


Implementation
    public function get distortionRadius():Number
    public function set distortionRadius(value:Number):void
graphicproperty 
graphic:String

Sets the graphic type: default, notch, or none.


Implementation
    public function get graphic():String
    public function set graphic(value:String):void
magnificationproperty 
magnification:Number

The value of magnification of the lens, this can be increased or decreasted by performing a rotation gesture on the lens, and its starting value can be set in CML. The max magnification is 50, the minimum is 1.

The default value is 5;.


Implementation
    public function get magnification():Number
    public function set magnification(value:Number):void
maxObjectScaleproperty 
maxObjectScale:Number  [read-only]


Implementation
    public function get maxObjectScale():Number
radiusproperty 
radius:Number

Radius of the total area of the lens, including distortion effects if any.

The default value is 100.


Implementation
    public function get radius():Number
    public function set radius(value:Number):void
zoomMaxproperty 
zoomMax:Number

The maximum zoom out value.

The default value is 1.0.


Implementation
    public function get zoomMax():Number
    public function set zoomMax(value:Number):void
zoomMinproperty 
zoomMin:Number

The minimum zoom in value.

The default value is 1.0.


Implementation
    public function get zoomMin():Number
    public function set zoomMin(value:Number):void
zoomRotateFactorproperty 
zoomRotateFactor:Number

Sets how fast rotating zooms in.

The default value is 0.01.


Implementation
    public function get zoomRotateFactor():Number
    public function set zoomRotateFactor(value:Number):void
Constructor Detail
Magnifier()Constructor
public function Magnifier()

Constructor

Method Detail
dispose()method
override public function dispose():void

Destructor

init()method 
override public function init():void

updateFilter()method 
public function updateFilter():void