Class com.robertpataki.heartcode.ProgressIndicator

Description

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:

Examples

Example 1: If the constructor is called without parameters it generates a default animation.

 import com.robertpataki.heartcode.ProgressIndicator;
 
 var preloader:ProgressIndicator = new ProgressIndicator();
 

ProgressIndicator_01.png


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;
 

ProgressIndicator_02.png

Field Index

SHAPE_CIRCLE, SHAPE_ELLIPSE, SHAPE_SQUARE, SHAPE_STAKE, SHAPE_TRIANGLE

Inherited from MovieClip

_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

Method Index

new ProgressIndicator()

kill(), togglePause()

Inherited from MovieClip

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()

Constructor Detail

ProgressIndicator

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.

Parameters

parentThe container MovieClip object. The default value is _root
nameThe name of the Preloader instance. The default value is "preloader_mc"
shapeThe shape of the preloader bits. The default value is defaultShape.
densitySets the fineness of the preloader. The default value is 12.
rangeSets the range of bits to be animated. The default value is 0.8.
colorSets the color of the preloader. The default value is 0x666666.
radiusThe radius of the circle the shapes are drawn around. The default value is 14.
frequencyThe refreshing frequency of each bit (in seconds). The default value is 0.05.
fadeIf set to true the non-animated bits of the preloader are invisible. This gives the a nice dynamic look. The default value is false.

See Also

Field Detail

SHAPE_SQUARE

static public SHAPE_SQUARE:String

SHAPE_CIRCLE

static public SHAPE_CIRCLE:String

SHAPE_STAKE

static public SHAPE_STAKE:String

SHAPE_ELLIPSE

static public SHAPE_ELLIPSE:String

SHAPE_TRIANGLE

static public SHAPE_TRIANGLE:String

Method Detail

togglePause

public function togglePause():Void

Pauses or resumes the animation.

kill

public function kill():Void

Kills the preloader.