home *** CD-ROM | disk | FTP | other *** search
- class com.argosy.ui.LoadBar extends com.argosy.ui.baseUI
- {
- var tf;
- var load_percent;
- var normal_style;
- var bg;
- var bar;
- var fillbar;
- var drop_shadow;
- var bevel_filter;
- function LoadBar()
- {
- super();
- }
- function set text(str)
- {
- this.tf.htmlText = "<p><loader>" + str + "</loader></p>";
- }
- function get text()
- {
- return this.tf.text;
- }
- function set percent(p)
- {
- this.load_percent = p;
- if(this.load_percent >= 1)
- {
- this._alpha = 100;
- this._visible = false;
- }
- else
- {
- this._alpha = 100;
- this._visible = true;
- this.drawBar();
- }
- }
- function get percent()
- {
- return this.load_percent;
- }
- function init()
- {
- super.init();
- this.setSize(300,100);
- this._visible = false;
- }
- function createChildren()
- {
- this.normal_style = new TextField.StyleSheet();
- this.normal_style.setStyle("p",{fontFamily:"Frutiger Bold",fontSize:"12",color:"#000000",textAlign:"left",textDecoration:"none",kerning:"true",letterSpacing:"0"});
- this.normal_style.setStyle("loader",{fontFamily:"Frutiger Bold",fontSize:"14",color:"#438CB8"});
- this.bg = this.createEmptyMovieClip("bg",1);
- this.bar = this.createEmptyMovieClip("bar",2);
- this.fillbar = this.createEmptyMovieClip("fillbar",4);
- this.tf = this._createTextField(this,"tf",100,0,0,100,20,this.normal_style,"");
- this.drop_shadow = new flash.filters.DropShadowFilter(5,45,0,0.8,10,10,1,3);
- this.bevel_filter = new flash.filters.BevelFilter(5,45,16777215,0.8,0,0.8,20,20,1,3,"inner",false);
- this.bg.filters = [this.drop_shadow];
- this.fillbar.filters = [this.bevel_filter];
- }
- function drawBar()
- {
- var _loc2_ = this.width / 10;
- var _loc3_ = this.width - 2 * _loc2_;
- this.bar.clear();
- this.bar.lineStyle(2,16777215,50);
- this.bar.beginFill(16777215,20);
- this.bar.moveTo(_loc2_,0);
- this.bar.lineTo(_loc2_ + _loc3_,0);
- this.bar.lineTo(_loc2_ + _loc3_,20);
- this.bar.lineTo(_loc2_,20);
- this.bar.lineTo(_loc2_,0);
- this.bar.endFill();
- var _loc4_ = new flash.geom.Matrix();
- _loc4_.createGradientBox(_loc3_,20,1.5707963267948966,0,0);
- this.fillbar.clear();
- this.fillbar.lineStyle(2,4426936,50);
- this.fillbar.beginGradientFill("linear",[14409183,4426936],[100,100],[0,255],_loc4_,"pad");
- this.fillbar.moveTo(_loc2_,0);
- this.fillbar.lineTo(_loc2_ + _loc3_ * this.load_percent,0);
- this.fillbar.lineTo(_loc2_ + _loc3_ * this.load_percent,20);
- this.fillbar.lineTo(_loc2_,20);
- this.fillbar.lineTo(_loc2_,0);
- this.fillbar.endFill();
- }
- function layout()
- {
- var _loc2_ = this.width / 10;
- var _loc4_ = this.width - 2 * _loc2_;
- this.bg.clear();
- var _loc3_ = new flash.geom.Matrix();
- _loc3_.createGradientBox(this.width,this.height,1.5707963267948966,0,0);
- this.bg.lineStyle(2,4426936,100);
- this.bg.beginGradientFill("linear",[14409183,10856103],[100,100],[0,255],_loc3_,"pad");
- this.bg.lineTo(this.width,0);
- this.bg.lineTo(this.width,this.height);
- this.bg.lineTo(0,this.height);
- this.bg.lineTo(0,0);
- this.bg.endFill();
- this.tf._x = _loc2_;
- this.tf._y = 10;
- this.tf._width = _loc4_;
- this.bar._y = this.tf._y + this.tf._height + 10;
- this.fillbar._y = this.bar._y;
- this.drawBar();
- }
- }
-