Trail Documentation
Author: Alex Uhlmann
Last Modified: 09/23/05 19:45:31
Summary
Trail class:
Trail Properties:
Trail Methods:
version: Documentation not provided.
description:
Simulates a trail effect on animated movieclips. Attaches the trail to a movieclip. If null is specified the animation will be infinite.
Example 1: (Example .swf) Attach a small trail to a back and forth moving movieclip. The trail will expire in 10 seconds.
mc._x = 150;
mc._y = 200;
var myMove:Move = new Move(mc);
myMove.animationStyle(2000,Expo.easeInOut,"onCallback");
myMove.run(500,mc._y);
new Trail(mc).attach(50,40,10000);
myListener.onCallback = function()
{
myMove.callback = "onCallback2";
myMove.run(150,mc._y);
}
myListener.onCallback2 = function()
{
myMove.callback = "onCallback";
myMove.run(500,mc._y);
}
Example 2: (Example .swf) attaches a longer trail to a rotating movieclip. Note: if no duration property is
specified, the default duration property is used. The default property of duration is 1000. See AnimationCore.
Take a look to MoveOnCurve for another example.new Rotation(mc).run(360); new Trail(mc).attach(250,40);
There are two ways to use this class. One way is to specify the duration property outside the current method, either with setting the property directly or with the animationStyle() method like it is used in de.alex_uhlmann.animationpackage.drawing.
usage:
var myTrail:Trail = new Trail(mc);parameters:
(MovieClip) Movieclip to simulate a trail effect on.
(Number) Duration of animation in milliseconds.
description:
usage:
myTrail.attach(decay, startAlpha);
myTrail.attach(decay, startAlpha, milliseconds);
parameters:
returns: void
description: offers the opportunity to remove an attached Trail. In particular, this might be useful if a trail is of infinite length (if null is specified for milliseconds).
usage:
myInstance.remove();
returns: void
description: set animation setting for animation.
usage:
myTrail.animationStyle(milliseconds);
parameters:
returns: Void.
description: stops the animation if not locked..
usage: myInstance.stop();
returns: true if instance was successfully stopped.
false if instance could not be stopped, because it was locked.
description: pauses the animation if not locked. Call resume() to continue animation.
usage: myInstance.pause();
parameters:
returns: true if instance was successfully paused.
false if instance could not be paused, because it was locked.
description: continues the animation if not locked.
usage: myInstance.resume();
returns: true if instance was successfully resumed.
false if instance could not be resumed, because it was locked.
description: locks the animation to prevent pausing, resuming and stopping. Default is unlocked.
usage: myInstance.lock();
returns: Void.
description: unlocks the animation to allow pausing, resuming and stopping. Default is unlocked.
usage: myInstance.unlock();
returns: Void.
description: checks if the instance is currently animated.
usage: myInstance.isTweening();
returns: true if instance is tweening,
false if instance is not tweening.
description: returns the elapsed time in milliseconds since the current tween started tweening.
usage: myInstance.getDurationElapsed();
returns: Number
description: returns the remaining time in milliseconds since the current tween started tweening.
usage: myInstance.getDurationRemaining();
returns: Number
description: Subscribe to a predefined event. The following standard EventDispatcher events are broadcasted
onStart, broadcasted when animation starts.
onEnd, broadcasted when animation ends.
The even object returned, contains the following properties:
type (String) event broadcasted.
target (Object) event source.
usage:
myTrail.addEventListener(event, listener);
myTrail.addEventListener(event, listener, handler);
parameters:
returns: Void.
description: Removes a listener from a subscribed event.
usage:
myTrail.removeEventListener(event, listener);
myTrail.removeEventListener(event, listener, handler);
parameters:
returns: Void.
description: GDispatcher specific feature. Removes all listeners for a specific event, or for all events.
usage:
myTrail.removeAllEventListeners();
myTrail.removeAllEventListeners(event);
parameters:
returns: Void.
description: GDispatcher specific feature. Checks if a listener is already subscribed to a certain event.
usage:
myTrail.eventListenerExists(event, listener);
myTrail.eventListenerExists(event, listener, handler);
parameters:
returns: true if event exists on listener.
false if event doesn't exist on listener.
description: returns a unique ID of the instance. Usefull for associative arrays.
usage: myInstance.getID();
returns: Number
description: returns the name of the class.
usage: myInstance.toString();
returns: String