API Documentation | All Packages | All Classes | Index | Frames No Frames |
Class DynamicPinPoint

Package | com.greensock.layout
Class | public class DynamicPinPoint
Inheritance | DynamicPinPoint PinPoint flash.geom.Point

Sometimes it's useful to have a PinPoint base its coordinates on some custom criteria, like the edge of another DisplayObject or the center of an object whose width/height changes frequently, so DynamicPinPoint allows you to associate a function (one you define) that returns a Point instance that will determine the DynamicPinPoint's x/y values. For example, to make the DynamicPinPoint position itself at the center bottom of the "video_mc" object and then attach a "mc" object, you could do this:
`var pin:DynamicPinPoint = new DynamicPinPoint(video_mc, getBottomCenter);
pin.attach(mc);
function getBottomCenter():Point {
var bounds:Rectangle = video_mc.getBounds(video_mc);
return new Point(bounds.x + bounds.width / 2, bounds.y + bounds.height);
}
//if you want to initially position the "mc" object directly on the DynamicPinPoint, you could add this:
var p:Point = pin.toLocal(mc.parent);
mc.x = p.x;
mc.y = p.y;
` Copyright 2011, GreenSock. All rights reserved. This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for corporate Club GreenSock members, the software agreement that was issued with the corporate membership.

Public Properties

| Property | Defined by
--- | --- | ---
|  | getter : Function the function to be called which will return a Point object defining the new coordinates (based on the target's coordinate space) | DynamicPinPoint

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined by
--- | --- | ---
|  | DynamicPinPoint(target:DisplayObject, getter:Function, liquidStage:LiquidStage = null) Constructor | DynamicPinPoint
|  | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void Use this to add an `Event.CHANGE` listener to find out when the PinPoint moves. | PinPoint
|  | attach(target:DisplayObject, strict:Boolean = false, reconcile:Boolean = true, tweenDuration:Number = 0, tweenVars:Object = null, roundPosition:Boolean = false):void Attaches a DisplayObject to a particular PinPoint (like `TOP_RIGHT`) so that any movement of the PinPoint will also affect the relative position of the DisplayObject. | PinPoint
|  | clone():Point | DynamicPinPoint
|  | destroy():void Destroys the PinPoint, making it eligible for garbage collection. | PinPoint
|  | dispatchEvent(event:Event):Boolean | PinPoint
|  | hasEventListener(type:String):Boolean | PinPoint
|  | release(target:DisplayObject):Boolean Releases a DisplayObject from being controlled by LiquidStage after having been attached. | PinPoint
|  | removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void | PinPoint
|  | toLocal(target:DisplayObject):Point Determines a PinPoint's coordinates according to any DisplayObject's coordinate space. | PinPoint
|  | update():void Forces an update of LiquidStage (useful if you manually changed this PinPoint's coordinates) | PinPoint
|  | willTrigger(type:String):Boolean | PinPoint

Property detail

getter | property

`getter:Function` [read-write]

the function to be called which will return a Point object defining the new coordinates (based on the target's coordinate space)

Implementation
`public function get getter():Function`
`public function set getter(value:Function):void`
Constructor detail

DynamicPinPoint | () | constructor

`public function DynamicPinPoint(target:DisplayObject, getter:Function, liquidStage:LiquidStage = null)`

Constructor

Parameters

| `target:DisplayObject` — target DisplayObject who is like the "parent" of this PinPoint (its coordinate system is used for the x and y values).
| `getter:Function` — the function to be called which will return a Point object defining the new coordinates (based on the target's coordinate space)
| `liquidStage:LiquidStage` (default = `null`)`` — Optionally declare the LiquidStage instance to which this PinPoint should be associated. If none is defined, the class will try to determine the LiquidStage instance based on the target's `stage` property (`LiquidStage.getByStage()`). The only time it is useful to specifically declare the LiquidStage instance is when you plan to subload a swf that uses LiquidStage into another swf that also has a LiquidStage instance (thus they share the same stage).

Method detail

clone | () | method

`public override function clone():Point`

Returns

| `Point`