BWAMovieClipUtils
| Kind of class: | class |
|---|---|
| Inherits from: | none |
| Classpath: | util.BWAMovieClipUtils |
| File last modified: | Monday, 06 November 2006, 08:09:08 |
Summary
Class methods
Class methods
smoothMovieClip
static function smoothMovieClip (
inClip:MovieClip) : MovieClip
Smoothes the image of a MovieClip, by copying the image bitmap data to a new MovieClip.
Parameters:
inClip:
the MovieClip to smooth the image of
Returns:
A new MovieClip with the smoothed bitmap data of the original clip.
Usage note:
If the passed clip
inClip is a class member, the reference to the original member will be lost. For instanceprivate var clip_mc:MovieClip; // after smoothing: clip_mc._x = 100; // does not workThe solution is to make the member reference dynamic:
private var mImageClip:MovieClip; // Sets the reference to the image clip after smoothing so Image knows which clip to handle. public function setImageClip (inClip:MovieClip) : Void { mImageClip = inClip; } // after smoothing: mImageClip._x = 100;
Example:
To use
smoothMovieClip with Loaderprivate function onLoadDone (e:LoaderEvent) : Void { var clip:MovieClip = MovieClip(e.targetClip); var smoothedClip:MovieClip = util.BWAMovieClipUtils.smoothMovieClip(clip); }To set the smoothed image clip reference dynamically, add:
// tell parent image to use the new smoothed clip var parent:MovieClip = smoothedClip._parent; parent.setImageClip(smoothedClip);In the parent class, write:
public function setImageClip (inClip:MovieClip) : Void { mImageClip = inClip; }