Package | com.greensock.layout |
Class | public class DynamicPinPoint |
Inheritance | DynamicPinPoint PinPoint flash.geom.Point |
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 2010, 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.
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 |
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):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 |
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
DynamicPinPoint | () | constructor |
public function DynamicPinPoint(target:DisplayObject, getter:Function, liquidStage:LiquidStage = null)
Constructor
Parameterstarget: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).
|
clone | () | method |
public override function clone():Point
Returns
Point |