public class LoaderClassStatic
The LoaderClassStatic class allows loading movies and bitmaps, all objects usually loaded with the Loader class. The difference to the LoaderClass is that this class will allow to unload the urlLoader and create the urlLoader only once. This is very suitable for slideshows or any applications, where unloading a Loader is required. Use the constructor new LoaderClassStatic() to create a new LoaderClassStatic object and add parameters as desired.

See also



Public Properties
Property Defined By
All inherited properties of the Sprite class. N/A
loaderBarX : int
Specifies the x position of the loaderbar.
loaderBarY : int
Specifies the x position of the loaderbar.
Public Methods
Method Defined By
Creates a new instance of the LoaderClassStatic class.
initLoader(myURL:String, loadFinished:Function, myTarget:Object, lBar:String=null)
Proceeds with loading.
Event Defined By
All inherited events for the Sprite class. N/A
Property Detail
loaderBarX property
loaderBarX:int [read-write]

Specifies the x position of the loaderbar.

The default value is 0.


public function get loaderBarX():int
public function set loaderBarX(value:int):void
loaderBarY property
loaderBarY:int [read-write]

Specifies the y position of the loaderbar.

The default value is 0.


public function get loaderBarY():int
public function set loaderBarY(value:int):void
Constructor Detail
LoaderClassStatic ()  Constructor
public function LoaderClassStatic()
Intializes a new LoaderClassStatic instance with the specified parameters.
Method Detail
initLoader ():void  method
public function initLoader(myURL:String, loadFinished:Function, myTarget:Object, lBar:String=null)


  • myURL:String ____ The server-side file used to handle the variables.
  • loadFinished:Function ____ The name of the function for the completed event.
  • myTarget:Object ____ The object to dispatch the event to.
  • lBar:String=null ____ Optional: The class name for a 100 frames loader animation, must stay in the library.
Create a new fla file and name it Loaderclassstatic.fla. Place the fla in the same folder as the biz folder. Have two movies or images etc ready in the same folder. Place a button component on the timeline and name it submitBut. Then create an Actionscript file, name it Loaderclassstatic.as and place this script. Change the names for the movies etc in the script accordingly.
	import flash.display.Sprite;
	import fl.controls.Button;
	import biz.flashscript.utils.LoaderClassStatic;
	import flash.events.MouseEvent;
	import flash.events.Event;

	public class Loaderclassstatic extends Sprite
		public var submitBut:Button;
		private var myLoader:LoaderClassStatic;
		private var url:String = "xml_files/Zoom.swf";
		public function Loaderclassstatic ():void
			submitBut.label = "SUBMIT";
			submitBut.addEventListener (MouseEvent.CLICK, clickHandler);
			myLoader = new LoaderClassStatic();
			myLoader.initLoader (url, completed,this);
		private function clickHandler (e:MouseEvent):void
				url = "xml_files/testmovie.swf";
				myLoader.initLoader (url, completed, this);
		private function completed (e:Event):void
			trace ("loaded");