Skip to content

ActionScript 2/3 progress indicator. CPU and memory efficient, very easy to customize.

Notifications You must be signed in to change notification settings

heartcode/ProgressIndicator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AS2/3 progress indicator class

ProgressIndicator is a simple progress indicator class which can draw different pre-defined shapes arranged in a circle. I built it from scratch and tried to make it as CPU and memory efficient and easy to use as possible.

You can use the tool to

  • give user feedback on form data submission process
  • display it until you load something which doesn't require a proper 'percentage' preloader
  • add to your existing (real) preloader
  • display any other sort of preload or time process you like

AS3 Compatible players:

  • Adobe Flash Player 9 or higher
  • Adobe AIR Player 1.1 or higher

AS2 Compatible players:

  • Adobe Flash Player 7 or higher
  • Adobe FlashLite Player 2.0 or higher
  • Adobe AIR Player 1.1 or higher

Flexibility

The class is very easy to customize. You can choose from a number of different shapes and also set the density, the amount of shapes animated and faded, the speed of the animation, the radius and color. Also, you can add any filters to it to make it cooler.

Usage

AS3:

If the constructor is called without any parameters passed it creates an auto-generated indicator.

import com.robertpataki.heartcode.ProgressIndicator;

var preloader_sp:ProgressIndicator = new ProgressIndicator();
preloader_sp.name = "preloader_sp";
addChild(preloader_sp);
preloader_sp.x = stage.stageWidth * 0.5;
preloader_sp.y = stage.stageHeight * 0.5;

The indicator can be customized by passing parameters to the constructor.

import com.robertpataki.heartcode.ProgressIndicator;
import flash.filters.BlurFilter;
import flash.filters.GlowFilter;

var preloader_sp:ProgressIndicator = new ProgressIndicator(ProgressIndicator.SHAPE_CIRCLE, 40, 1, 0x00ffff, 12, 0.03, true);
preloader_sp.name = "preloader_sp";
addChild(preloader_sp);

preloader_sp.filters = [new GlowFilter(0x00ffff, 0.6, 8, 8, 2, 2), new BlurFilter(2, 2, 2)];
preloader_sp.x = stage.stageWidth * 0.5;
preloader_sp.y = stage.stageHeight * 0.5;

AS2:

If the constructor is called without any parameters passed it creates an auto-generated indicator and places it on the stage.

import com.robertpataki.heartcode.ProgressIndicator;

new ProgressIndicator();

The indicator can be customized by passing parameters to the constructor.

import com.robertpataki.heartcode.ProgressIndicator;
import flash.filters.BlurFilter;
import flash.filters.GlowFilter;

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 * 0.5;
preloader_mc._y = Stage.height * 0.5;

If you don't know where to start see the HeartCode_QuickStartGuide_ProgressIndicator.pdf file for some help.

Credits

ProgressIndicator was created by Robert Pataki.

License

(The MIT License)

Copyright (c) 2010-2011 Robert Pataki [email protected];

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

ActionScript 2/3 progress indicator. CPU and memory efficient, very easy to customize.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published