Tag Archive | "Preloader"

Create An Apple Style Preloader Using A Custon Class

Create An Apple Style Preloader Using A Custon Class

Steven sacks just posted custom class that creates an Apple style preloader.  It’s a simple class that uses the Flash Drawing API which makes it light and efficient. Check it out below.

package net.stevensacks.preloaders
{
	package net.stevensacks.preloaders
	{
		import flash.events.TimerEvent;
		import flash.display.Sprite;
		import flash.display.Shape;
		import flash.utils.Timer;

		public class CircleSlicePreloader extends Sprite
		{
			private var timer:Timer = new Timer(65);
			private static const SLICE_COUNT:int = 12;
			private static const RADIUS:int = 6;

			public function CircleSlicePreloader()
			{
				super();
				draw();
				timer.addEventListener(TimerEvent.TIMER, onTimer, false, 0, true);
				timer.start();
			}

			private function onTimer(event:TimerEvent):void
			{
				rotation = (rotation + (360 / SLICE_COUNT)) % 360;
			}

			private function draw():void
			{
				var i:int = SLICE_COUNT;
				var degrees:int = 360 / SLICE_COUNT;
				while (i--)
				{
					var slice:Shape = getSlice();
					slice.alpha = Math.max(0.2, 1 - (0.1 * i));
					var radianAngle:Number = (degrees * i) * Math.PI / 180;
					slice.rotation = -degrees * i;
					slice.x = Math.sin(radianAngle) * RADIUS;
					slice.y = Math.cos(radianAngle) * RADIUS;
					addChild(slice);
				}
			}

			private function getSlice():Shape
			{
				var slice:Shape = new Shape();
				slice.graphics.beginFill(0x666666);
				slice.graphics.drawRoundRect(-1, 0, 2, 6, 12, 12);
				slice.graphics.endFill();
				return slice;
			}
		}
	}
}

Additional Resources:

Posted in Custom Classes, Industry News, Latest Adobe Flash News, Latest Adobe Flex NewsComments (0)

Create a Loading Spinner Within Flex

Create a Loading Spinner Within Flex

Create a loading spinner within Flex with this neat tool called loading spinner. Loading spinner is a Flex component similar to the many “spinner.gif” that are used on Web 2.0 pages. This is a sort of progress indicator that can be used to demonstrate to the user that something is happening.

loading_spinner_panel

Loading spinner provides many customizable options which allow you to customize the look and feel of your loader.  This flex component can definitely come in handy when developing your next Flex project.  Enjoy!

Download loading spinner

Posted in Flex Components, Industry NewsComments (0)

Page 1 of 11