Constructors

Methods

DistortionTweener class

DistortionTweener

extends EventDispatcher

 

 

Overview

Author

Matt Przybylski [http://www.reintroducing.com]

Version

1.0

Description

The DistortionTweener allows you to distort four points of an object. It is an easy to way make distortions such as trapezoids on a movie clip. The DistortionTweener uses Ruben Swieringa's DistortImage class (http://www.rubenswieringa.com/blog/distortimage) and is based on a sample .FLA provided by Tam Ho (http://www.flashteam.com.au) on how to use DistortImage in Flash.

Constructors

 

DistortionTweener

Usage

public function DistortionTweener($holder:*, $mc:MovieClip, $tl:Point, $tr:Point, $br:Point, $bl:Point, $precision:uint):void

Description

Creates a new instance of the DistortionTweener class. The point values are relative to the holder clip, NOT the stage.

Parameters

$holder
The DisplayObject that will be used to hold your distorted bitmap
$mc
The source movie clip that will be used to copy into the bitmap that will be distorted
$tl
The top left point to use in the distortion
$tr
The top right point to use in the distortion
$br
The bottom right point to use in the distortion
$bl
The bottom left point to use in the distortion
$precision
A uint representing the value to use as the precision in the DistortImage class

Methods

 

tweenTo

Usage

public function tweenTo($tl:Point, $tr:Point, $br:Point, $bl:Point, $tweenFunc:Function, $time:Number):void

Description

Tweens the distortion. As with the constructor, the point values are relative to the holder clip, NOT the stage.

The tweenTo method dispatches two events:

  • Event.INIT: Dispatched when the tweening begins
  • Event.COMPLETE: Dispatched when the tweening ends

Parameters

$tl
The top left point to end the tween at
$tr
The top right point to end the tween at
$br
The bottom right point to end the tween at
$bl
The bottom left point to end the tween at
$tweenFunc
The easing function to use in the tween
$time
The duration, in seconds, of the tween

Returns

void
 

reset

Usage

public function reset($tl:Point, $tr:Point, $br:Point, $bl:Point):void

Description

Resets the bitmap to the specified points.

Parameters

$tl
The top left point to use in the distortion
$tr
The top right point to use in the distortion
$br
The bottom right point to use in the distortion
$bl
The bottom left point to use in the distortion

Returns

void
 

destroy

Usage

public function destroy():void

Description

Cleans up the DistortionTweener for garbage collection.

Returns

Nothing