Section 1
//PreloaderEvent (com.Preloaderz.events.PreloaderEvent)
package com.Preloaderz.events {
import flash.events.*;
public dynamic class PreloaderEvent extends Event {
private var _reason:String;
private var _value:Number;
private var __target:Object;
public static const LOADING_ERROR:String = "loadingError";
public static const PROGRESS_STATUS:String = "progressStatus";
public static const PROGRESS_COMPLETE:String = "progressComplete";
public function PreloaderEvent(_arg1:String, _arg2:String="default", _arg3:Number=0, _arg4:Object=null){
super(_arg1, true);
_reason = _arg2;
_value = _arg3;
__target = _arg4;
}
public function get __value():Number{
return (_value);
}
public function get __reason():String{
return (_reason);
}
public function get __targetMovieClip():Object{
return (__target);
}
}
}//package com.Preloaderz.events
Section 2
//Preloader (com.Preloaderz.Preloader)
package com.Preloaderz {
import flash.display.*;
import flash.events.*;
import com.Preloaderz.events.*;
import flash.utils.*;
import flash.net.*;
public class Preloader extends Sprite {
public var ava:MovieClip;
private var __target:MovieClip;// = null
private var __skin:String;// = ""
private var __source:String;// = ""
private var __finalWidth:Number;
private var __finalHeight:Number;
private var __skinType:String;
private var m_content:MovieClip;
private var m_mcBG:MovieClip;
private var m_mcProgress:MovieClip;
private var __bStarter:Boolean;
private var __livePreview:Boolean;
private var m_curProgress:Number;
private var __loader:Loader;
private var __httpStatus:int;// = 0
public static var TYPE_CYCLIC = "cyclic";
public static var TYPE_PROGRESSIVE = "progressive";
public function Preloader(){
__loader = new Loader();
super();
__livePreview = ((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")));
__skinType = _slot1.TYPE_CYCLIC;
this.addEventListener(Event.ENTER_FRAME, onLoad);
}
public function set skinSwf(_arg1:String):void{
__skin = _arg1;
}
public function get skinSwf():String{
return (__skin);
}
public function set target(_arg1):void{
if ((_arg1 is String)){
__target = root[_arg1];
} else {
if ((_arg1 is MovieClip)){
__target = _arg1;
} else {
__target = null;
};
};
}
public function get target():MovieClip{
return (__target);
}
public function set source(_arg1:String):void{
__source = _arg1;
}
public function get source():String{
return (__source);
}
public function set skinType(_arg1:String):void{
__skinType = _arg1;
}
public function get skinType():String{
return (__skinType);
}
public function set resizeLoadedWidth(_arg1:Number):void{
__finalWidth = _arg1;
}
public function get resizeLoadedWidth():Number{
return (__finalWidth);
}
public function set resizeLoadedHeight(_arg1:Number):void{
__finalHeight = _arg1;
}
public function get resizeLoadedHeight():Number{
return (__finalHeight);
}
private function configureListeners(_arg1:IEventDispatcher):void{
_arg1.addEventListener(Event.COMPLETE, onPreLoadInit);
_arg1.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
_arg1.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
_arg1.addEventListener(ProgressEvent.PROGRESS, progressHandler);
}
private function onLoad(_arg1:Event){
if (__livePreview){
return;
};
this.removeEventListener(Event.ENTER_FRAME, onLoad);
m_content = new MovieClip();
addChild(m_content);
if ((((__skin == "")) || ((__skin == "default")))){
m_mcProgress = attachMovie(m_content, "cubeSkin", "progressSkin");
} else {
m_mcProgress = attachMovie(m_content, __skin, "progressSkin");
};
SetProgress(0);
this["ava"].visible = false;
if (__source == ""){
dispatchEvent(new PreloaderEvent(PreloaderEvent.LOADING_ERROR, "Nothing is loaded in constructor, waiting to load call"));
return;
};
loadIt(__source, __target);
}
private function onResize(){
}
private function SetProgress(_arg1:Number){
if (_arg1 < 0){
_arg1 = 0;
} else {
if (_arg1 > 100){
_arg1 = 100;
};
};
if (m_curProgress != _arg1){
m_curProgress = _arg1;
updateProgress();
dispatchEvent(new PreloaderEvent(PreloaderEvent.PROGRESS_STATUS, "", getProgress()));
};
}
public function getProgress():Number{
return (m_curProgress);
}
private function updateProgress():void{
if (__skinType == _slot1.TYPE_PROGRESSIVE){
m_mcProgress.gotoAndStop(Math.round(((m_mcProgress.totalframes * getProgress()) / 100)));
};
}
public function load(){
loadIt(source, target);
}
private function loadIt(_arg1:String, _arg2:MovieClip){
if (_arg1 == ""){
dispatchEvent(new PreloaderEvent(PreloaderEvent.LOADING_ERROR, "Empty or undefined source"));
return;
};
var _local3:MovieClip = getValidTarget(_arg2);
__target = _local3;
__bStarter = true;
configureListeners(__loader.contentLoaderInfo);
__loader.load(new URLRequest(_arg1));
}
private function getValidTarget(_arg1):MovieClip{
var _local2:MovieClip;
if (((!((_arg1 == null))) && (!((_arg1 == ""))))){
if (typeof(_arg1) == "string"){
return (root[_arg1.toString()]);
};
return (_arg1);
//unresolved jump
};
_local2 = new MovieClip();
this.parent.addChild(_local2);
_local2.x = this.x;
_local2.y = this.y;
return (_local2);
}
private function progressHandler(_arg1:ProgressEvent){
if (__bStarter){
if (((!((_arg1.bytesTotal == 12))) && ((_arg1.bytesTotal > 0)))){
SetProgress(((_arg1.bytesLoaded / _arg1.bytesTotal) * 100));
};
};
}
private function httpStatusHandler(_arg1:HTTPStatusEvent){
__httpStatus = _arg1.status;
}
private function ioErrorHandler(_arg1:IOErrorEvent){
dispatchEvent(new PreloaderEvent(PreloaderEvent.LOADING_ERROR, ((("Error:" + _arg1.text) + "; HTTP Status:") + __httpStatus)));
}
private function onPreLoadStart(_arg1:MovieClip){
__bStarter = true;
}
private function onPreLoadInit(_arg1:Event){
__bStarter = false;
m_mcProgress.parent.removeChild(m_mcProgress);
__target.addChild(__loader);
dispatchEvent(new PreloaderEvent(PreloaderEvent.PROGRESS_COMPLETE, "", 100, __target));
this.m_content.visible = false;
m_content.parent.removeChild(m_content);
if (resizeLoadedHeight != 0){
__target.height = resizeLoadedHeight;
};
if (resizeLoadedWidth != 0){
__target.width = resizeLoadedWidth;
};
}
public static function attachMovie(_arg1:Object, _arg2:String, _arg3:String){
var instance:*;
var definition:*;
var parent = _arg1;
var className = _arg2;
var name = _arg3;
if (parent == null){
trace("attachMovie error: parent is null.");
return;
};
if ((((!(className) is String)) || ((className.length == 0)))){
trace(("attachMovie error: className is empty or not String. parent = " + parent));
return;
};
try {
definition = getDefinitionByName(className);
} catch(error) {
trace(("attachMovie error: " + error));
return;
};
instance = new (definition);
instance.name = name;
parent.addChild(instance);
return (instance);
}
}
}//package com.Preloaderz
Section 3
//cubeSkin (cubeSkin)
package {
import flash.display.*;
public dynamic class cubeSkin extends MovieClip {
}
}//package
Section 4
//defaultSkin (defaultSkin)
package {
import flash.display.*;
public dynamic class defaultSkin extends MovieClip {
}
}//package