PathCorrectorAS3

Package:
Class:
Inheritance:
biz.flashscript.components.path
public class PathCorrectorAS3
AbstractClass (Sprite)
The PathCorrectorAS3 component is used for detecting a path of a MovieClip. It is placed inside of the MovieClip. When called an event is dispatched revealing the location of the MovieClip inside of the movie.
Public Properties
Property Defined By
loader : Boolean
When set true indicates that the component is in a childmovie.
PathCorrectorAS3
timeLine : String
Specifies the level (root) of the MovieClip such as the main Timeline, the Stage or a parent MovieClip.
PathCorrectorAS3
frame : String
Specifies if a MovieClip's timeline should go to a certain frame and stop or play.
PathCorrectorAS3
stopFrame : Boolean
Specifies if a MovieClip's timeline should go to a certain frame and stop.
PathCorrectorAS3
playFrame : Boolean
Specifies if a MovieClip's timeline should go to a certain frame and play.
PathCorrectorAS3
Public Methods
Method Defined By
PathCorrectorAS3()
Creates a new instance of the PathCorrectorAS3 component.
PathCorrectorAS3
getPath():Object
Defines a MovieClip, which is used in conjunction with stopFrame or playFrame.
PathCorrectorAS3
Events
Event Defined By

pathFinder

This event is dispatched when the there is a MovieClip using getPath(), whose timeline will go to a certain frame.

PathCorrectorAS3
All inherited events for the Sprite class. N/A
Property Detail

loader property
loader:Boolean [read-write]

When set true indicates that the component is in a childmovie, otherwise the component is located in a MovieClip including the main timeline.

The default value is false.

.

Implementation

public function get loader():Boolean
public function set loader(value:Boolean):void

timeLine property
timeLine:String [read-write]

Specifies the level (root) of the MovieClip such as the main Timeline, the Stage or a parent MovieClip.

There is no default value. .

.

Implementation

public function get timeLine():String
public function set timeLine(value:String):void

stopFrame property
stopFrame:Boolean [read-write]

Specifies if a MovieClip's timeline should go to a certain frame and stop. To use this frame must have a value.

The default value is false.

.

Implementation

public function get stopFrame():Boolean
public function set stopFrame(value:Boolean):void

playFrame property
playFrame:Boolean [read-write]

Specifies if a MovieClip's timeline should go to a certain frame and play. To use this frame must have a value.

The default value is false.

.

Implementation

public function get playFrame():Boolean
public function set playFrame(value:Boolean):void

frame property
frame:String [read-write]

Specifies if a MovieClip's timeline should go to a certain frame and stop or play. frame is used in conjunction with stopFrame or playFrame.

The default value is defaultValue.

.

Implementation

public function get frame():String
public function set frame(value:String):void
Constructor Detail
PathCorrectorAS3 ()  Constructor
public function PathCorrectorAS3()
Intializes a new PathCorrectorAS3 instance.
Method Detail
getPath()  method
This method will get the path and final identity for the Object, which is defined by timeLine. Use this method to further manipulate the object after its identity and path is established. This method is used inside of the pathFinder event listener.
Event Detail

pathFinder event

Event Object Type: biz.flashscript.components.path.PathCorrectorAS3
Event.type property = biz.flashscript.components.path.PathCorrectorAS3.PATH_FINDER

Dispatched when the identity and the path of the timeLine object is established (see example).

Examples
EXAMPLE 1: Create a new fla file and name it PathCorrectorAS3.fla. Place the fla in the same folder as the biz folder. Add a shape object and create a tween. Then create a MovieClip, Clip1, containing a second MovieClip with the name "mctwo". Place an instance of Clip1 on the main timeline and name it "mc1". Give the second frame of the main timeline the name "frame2". Then add this script in frame 1 on the main timeline and test movie. You should see the timeline moving to frame 2 when you click anywhere on the stage.
stop ();
import biz.flashscript.components.path.PathCorrectorAS3;
var pc:PathCorrectorAS3 = new PathCorrectorAS3();
mc1.mctwo.addChild (pc);
pc.timeLine = "root";
pc.addEventListener ("pathFinder", pf);
var pathObject:Object;
function pf (e:Event):void
{
	pathObject = e.currentTarget.getPath();
}
stage.addEventListener (MouseEvent.CLICK, ch);
function ch (e:MouseEvent):void
{
	trace ("Path: "+pathObject);// trace is "Path: [object MainTimeline]"
	pathObject.gotoAndPlay ("frame2");
}
EXAMPLE 2: Create a new fla file and name it PathCorrectorAS3_2.fla. Place the fla in the same folder as the biz folder. Create a MovieClip, Clip1, containing a second MovieClip with the name "mctwo". Add a tween inside of Clip1. Place an instance of Clip1 on the main timeline and name it "mc1". Then add this script in a frame on the main timeline and test movie. You should see the tween in Clip1 being executed. Instead of a script the component can also be placed directly inside the second MovieClip (Clip2) and parameters added manually.
import biz.flashscript.components.path.PathCorrectorAS3;
var pc:PathCorrectorAS3 = new PathCorrectorAS3();
mc1.mctwo.addChild (pc);
pc.timeLine = "mc1";
pc.frame = "2";
pc.playFrame = true;
pc.addEventListener ("pathFinder", pf);
var pathObject:Object;
function pf (e:Event):void
{
	pathObject = e.currentTarget.getPath();
	trace(pathObject.name);// trace is "mc1"
}