class IMG_Loader_Tint extends mx.core.UIComponent { var parent_mc, _x, _y, auto_load, image_str, image_width, image_height, easing_type, easing_speed, invalidate, __get____width, __get____height, _loaded, _total, _percent, __get__autoLoad, __get__contentPath, scale_content, __get__scaleContent, __get__easingType, __get__easingSpeed, loader_visible, __get__preloader, loader_color, __get__preloaderColor, transition_bool, __get__transition, transition_color, __get__transitionColor, __set__autoLoad, __set__scaleContent, __set__easingType, __set__easingSpeed, __set__preloader, __set__preloaderColor, __set__transition, __set__transitionColor, dispatchEvent, loader_mc, loader_brd, onEnterFrame, image_mc, __set____height, __set____width, __get__bytesLoaded, __get__bytesTotal, __set__contentPath, __get__percentLoaded; function IMG_Loader_Tint() { super(); parent_mc = this; parent_mc.$obj = this; parent_mc._x = Math.ceil(_x); parent_mc._y = Math.ceil(_y); mx.events.EventDispatcher.initialize(this); if (auto_load) { this.load(image_str); } // end if } // End of the function function get_parent_mc() { return (parent_mc); } // End of the function function get_image_str() { return (image_str); } // End of the function function get_image_width() { return (image_width); } // End of the function function get_image_height() { return (image_height); } // End of the function function get_easing_type() { if (easing_type == "none") { return (IMG_Loader_Tint.easeNone); } else if (easing_type == "in") { return (IMG_Loader_Tint.easeIn); } else if (easing_type == "out") { return (IMG_Loader_Tint.easeOut); } // end else if } // End of the function function get_easing_speed() { switch (easing_speed) { case 1: { return (3000); break; } case 2: { return (2000); break; } case 3: { return (1000); break; } case 4: { return (400); break; } case 5: { return (350); break; } case 6: { return (250); break; } case 7: { return (200); break; } case 8: { return (150); break; } case 9: { return (50); break; } case 10: { return (10); break; } } // End of switch } // End of the function function set __width(w) { image_width = Math.ceil(w); this.invalidate(); //return (this.__width()); null; } // End of the function function get __width() { return (image_width); } // End of the function function set __height(h) { image_height = Math.ceil(h); this.invalidate(); //return (this.__height()); null; } // End of the function function get __height() { return (image_height); } // End of the function function get bytesLoaded() { return (_loaded); } // End of the function function get bytesTotal() { return (_total); } // End of the function function get percentLoaded() { return (_percent); } // End of the function function set autoLoad(bool) { auto_load = bool; this.invalidate(); //return (this.autoLoad()); null; } // End of the function function get autoLoad() { return (auto_load); } // End of the function function set contentPath(str) { image_str = str; this.invalidate(); //return (this.contentPath()); null; } // End of the function function get contentPath() { return (image_str); } // End of the function function set scaleContent(bool) { scale_content = bool; this.invalidate(); //return (this.scaleContent()); null; } // End of the function function get scaleContent() { return (scale_content); } // End of the function function set easingType(str) { easing_type = str; this.invalidate(); //return (this.easingType()); null; } // End of the function function get easingType() { return (easing_type); } // End of the function function set easingSpeed(num) { easing_speed = num; this.invalidate(); //return (this.easingSpeed()); null; } // End of the function function get easingSpeed() { return (easing_speed); } // End of the function function set preloader(str) { loader_visible = str; this.invalidate(); //return (this.preloader()); null; } // End of the function function get preloader() { return (loader_visible); } // End of the function function set preloaderColor(num) { loader_color = num; this.invalidate(); //return (this.preloaderColor()); null; } // End of the function function get preloaderColor() { return (loader_color); } // End of the function function set transition(str) { transition_bool = str; this.invalidate(); //return (this.transition()); null; } // End of the function function get transition() { return (transition_bool); } // End of the function function set transitionColor(obj) { transition_color = obj; this.invalidate(); //return (this.transitionColor()); null; } // End of the function function get transitionColor() { return (transition_color); } // End of the function function draw() { if (this.__get__autoLoad() == undefined) { this.__set__autoLoad(true); } // end if if (this.__get__scaleContent() == undefined) { this.__set__scaleContent(false); } // end if if (this.__get__easingType() == undefined) { this.__set__easingType("out"); } // end if if (this.__get__easingSpeed() == undefined) { this.__set__easingSpeed(6); } // end if if (this.__get__preloader() == undefined) { this.__set__preloader("on"); } // end if if (this.__get__preloaderColor() == undefined) { this.__set__preloaderColor(10066329); } // end if if (this.__get__transition() == undefined) { this.__set__transition("on"); } // end if if (this.__get__transitionColor() == undefined) { this.__set__transitionColor({ra: 100, rb: 255, ga: 100, gb: 255, ba: 100, bb: 255, aa: 100, ab: 255}); } // end if this.load(); } // End of the function function dsp_img() { this.get_parent_mc().createEmptyMovieClip("image_mc", 3); this.get_parent_mc().createEmptyMovieClip("image_msk", 4); with (this.get_parent_mc().image_msk) { beginFill(0, 0); moveTo(0, 0); lineTo(10, 0); lineTo(10, 10); lineTo(0, 10); lineTo(0, 0); } // End of with } // End of the function function dsp_preloader() { this.get_parent_mc().createEmptyMovieClip("loader_brd", 5); this.get_parent_mc().loader_brd._x = this.image_width / 2 - 40; this.get_parent_mc().loader_brd._y = this.image_height / 2 - 5; with (this.get_parent_mc().loader_brd) { lineStyle(0, 0, 100); moveTo(0, 0); lineTo(80, 0); lineTo(80, 9.500000E+000); lineTo(0, 9.500000E+000); lineTo(0, 0); } // End of with var color = new Color(this.get_parent_mc().loader_brd); color.setRGB(this.loader_color); this.get_parent_mc().createEmptyMovieClip("loader_mc", 6); this.get_parent_mc().loader_mc._x = this.image_width / 2 - 38; this.get_parent_mc().loader_mc._y = this.image_height / 2 - 3; with (this.get_parent_mc().loader_mc) { beginFill(0, 100); moveTo(0, 0); lineTo(1, 0); lineTo(1, 6); lineTo(0, 6); lineTo(0, 0); endFill(); } // End of with var color = new Color(this.get_parent_mc().loader_mc); color.setRGB(this.loader_color); } // End of the function function load() { this.dsp_img(); var obj = new Object(); obj.path = this.get_parent_mc().image_mc; if (loader_visible == "on") { this.dsp_preloader(); } // end if this.get_parent_mc().onEnterFrame = function () { this.dispatchEvent({type: "progress", target: this}); if (obj.path.getBytesLoaded() > 10) { var _loc2 = obj.path.getBytesLoaded() / obj.path.getBytesTotal() * 77; loader_mc._width = _loc2; _loaded = obj.path.getBytesLoaded(); _total = obj.path.getBytesTotal(); _percent = Math.round(obj.path.getBytesLoaded() / obj.path.getBytesTotal() * 100); if (obj.path.getBytesLoaded() >= obj.path.getBytesTotal()) { loader_brd.removeMovieClip(); loader_mc.removeMovieClip(); delete this.onEnterFrame; if (transition_bool == "on") { obj.path._visible = false; if (scale_content) { this.prep_fx(image_width, image_height); } else { this.prep_fx(obj.path._width, obj.path._height); } // end else if } else if (scale_content) { obj.path._width = image_width; obj.path._height = image_height; } // end if } // end if } // end else if }; obj.path.loadMovie(this.get_image_str()); } // End of the function function prep_fx(w, h) { this.dispatchEvent({type: "complete", target: this}); this.get_parent_mc().image_mc._width = w; this.get_parent_mc().image_mc._height = h; var _loc2 = new Color(this.get_parent_mc().image_mc); var _loc3 = this.__get__transitionColor(); _loc2.setTransform(_loc3); this.get_parent_mc().image_mc._visible = true; this.dsp_fx(); } // End of the function function dsp_fx() { var current_num = 0; var r_a = transitionColor.ra; var r_b = transitionColor.rb; var g_a = transitionColor.gb; var g_b = transitionColor.gb; var b_a = transitionColor.ba; var b_b = transitionColor.bb; var a_a = transitionColor.aa; var a_b = transitionColor.ab; this.get_parent_mc().onEnterFrame = function () { var _loc2 = 100 - r_a; var _loc9 = -r_b; var _loc5 = 100 - g_a; var _loc3 = -g_b; var _loc10 = 100 - b_a; var _loc8 = -b_b; var _loc4 = 100 - a_a; var _loc11 = -a_b; r_a = this.get_easing_type()(current_num, r_a, _loc2, this.get_easing_speed(), 1); r_b = this.get_easing_type()(current_num, r_b, _loc9, this.get_easing_speed(), 1); g_a = this.get_easing_type()(current_num, g_a, _loc5, this.get_easing_speed(), 1); g_b = this.get_easing_type()(current_num, g_b, _loc3, this.get_easing_speed(), 1); b_a = this.get_easing_type()(current_num, b_a, _loc10, this.get_easing_speed(), 1); b_b = this.get_easing_type()(current_num, b_b, _loc8, this.get_easing_speed(), 1); a_a = this.get_easing_type()(current_num, a_a, _loc4, this.get_easing_speed(), 1); a_b = this.get_easing_type()(current_num, a_b, _loc11, this.get_easing_speed(), 1); var _loc6 = new Color(image_mc); var _loc7 = {ra: r_a, rb: r_b, ga: g_a, gb: g_b, ba: b_a, bb: b_b, aa: a_a, ab: a_b}; _loc6.setTransform(_loc7); if (r_a == 100 && r_b == 0 && g_a == 100 && g_b == 0 && b_a == 100 && b_b == 0 && a_a == 100 && a_b == 0) { delete this.onEnterFrame; } // end if ++current_num; }; } // End of the function static function easeIn(t, b, c, d) { t = t / d; return (-c * (Math.sqrt(1 - t / d * t) - 1) + b); } // End of the function static function easeOut(t, b, c, d) { t = t / d - 1; return (c * ((t / d - 1) * t * t + 1) + b); } // End of the function static function easeNone(t, b, c, d) { return (c * t / d + b); } // End of the function var className = "IMG_Loader_Tint.as"; static var symbolOwner = IMG_Loader_Tint; static var symbolName = "IMG_Loader_Tint.as"; var rgb = 255; } // End of Class