| Flashscript classes (ActionScript 3) | Home | MX | MX 2004 | Flash 8 | Flash 9 |Flash 10 |PHP |Components | Snippets | Contact | |
PathCorrectorAS3 |
|
|
| 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 |
| 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 |
| 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. .Implementationpublic function get loader():Booleanpublic 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. . .Implementationpublic function get timeLine():Stringpublic 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. .Implementationpublic function get stopFrame():Booleanpublic 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. .Implementationpublic function get playFrame():Booleanpublic 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. .Implementationpublic function get frame():Stringpublic 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
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"
}
|