A simple preloader animation. The AS2 version has been optimized to run on mobile devices with lower processor and memory allocation.
You can use it to
Compatible players:
Example 1: If the constructor is called without parameters it generates a default animation.
import com.robertpataki.heartcode.ProgressIndicator; var preloader:ProgressIndicator = new ProgressIndicator();
Example 2: The simple vector shapes could be much more fancy when some filters are applied.
import com.robertpataki.heartcode.ProgressIndicator; new ProgressIndicator(this, "preloader_mc", ProgressIndicator.SHAPE_CIRCLE, 40, 1, 0x00ffff, 12, 0.03, true); preloader_mc.filters = [new GlowFilter(0x00ffff, 0.6, 8, 8, 2, 2), new BlurFilter(2, 2, 2)]; preloader_mc._x = Stage.width / 2; preloader_mc._y = Stage.height / 2;
SHAPE_CIRCLE, SHAPE_ELLIPSE, SHAPE_SQUARE, SHAPE_STAKE, SHAPE_TRIANGLE
_alpha, _currentframe, _droptarget, _focusrect, _framesloaded, _height, _lockroot, _name, _parent, _quality, _rotation, _soundbuftime, _target, _totalframes, _url, _visible, _width, _x, _xmouse, _xscale, _y, _ymouse, _yscale, enabled, focusEnabled, hitArea, menu, tabChildren, tabEnabled, tabIndex, trackAsMenu, useHandCursor
attachAudio(), attachMovie(), attachVideo(), beginFill(), beginGradientFill(), clear(), createEmptyMovieClip(), createTextField(), curveTo(), duplicateMovieClip(), endFill(), getBounds(), getBytesLoaded(), getBytesTotal(), getDepth(), getInstanceAtDepth(), getNextHighestDepth(), getSWFVersion(), getTextSnapshot(), getURL(), globalToLocal(), gotoAndPlay(), gotoAndStop(), hitTest(), lineStyle(), lineTo(), loadMovie(), loadVariables(), localToGlobal(), moveTo(), nextFrame(), onData(), onDragOut(), onDragOver(), onEnterFrame(), onKeyDown(), onKeyUp(), onKillFocus(), onLoad(), onMouseDown(), onMouseMove(), onMouseUp(), onPress(), onRelease(), onReleaseOutside(), onRollOut(), onRollOver(), onSetFocus(), onUnload(), play(), prevFrame(), removeMovieClip(), setMask(), startDrag(), stop(), stopDrag(), swapDepths(), unloadMovie()
public function ProgressIndicator(parent:MovieClip, name:String, shape:String, density:Number, range:Number, color:Number, radius:Number, frequency:Number, fade:Boolean)
Creates a new preloader animation.
parent | The container MovieClip object. The default value is _root
|
name | The name of the Preloader instance. The default value is "preloader_mc"
|
shape | The shape of the preloader bits. The default value is defaultShape .
|
density | Sets the fineness of the preloader. The default value is 12 .
|
range | Sets the range of bits to be animated. The default value is 0.8 .
|
color | Sets the color of the preloader. The default value is 0x666666 .
|
radius | The radius of the circle the shapes are drawn around. The default value is 14 .
|
frequency | The refreshing frequency of each bit (in seconds). The default value is 0.05 .
|
fade | If set to true the non-animated bits of the preloader are invisible. This gives the a nice dynamic look. The default value is false .
|