home *** CD-ROM | disk | FTP | other *** search
- ScrollBar = function()
- {
- this._x = 0;
- this._y = 0;
- this.largeur = 100;
- this.hauteur = 20;
- this.donneeMax = 100;
- };
- ScrollBar.prototype = new MovieClip();
- ScrollBar.prototype.onEnterFrame = function()
- {
- if(this.donnee > -1)
- {
- this.afficheBar();
- }
- };
- ScrollBar.prototype.traceBar = function()
- {
- this.beginFill(this.colorBar,80);
- this.moveTo(0,0);
- this.lineTo(this.donnee * this.largeur / this.donneeMax,0);
- this.lineTo(this.donnee * this.largeur / this.donneeMax,this.hauteur);
- this.lineTo(0,this.hauteur);
- this.lineTo(0,0);
- this.endFill();
- };
- ScrollBar.prototype.traceContour = function()
- {
- this.lineStyle(1,this.colorline,50);
- this.moveTo(0,0);
- this.lineTo(this.largeur,0);
- this.lineTo(this.largeur,this.hauteur);
- this.lineTo(0,this.hauteur);
- this.lineTo(0,0);
- };
- ScrollBar.prototype.afficheBar = function()
- {
- this.clear();
- this.traceBar();
- this.traceContour();
- };
- ScrollBar.prototype.init = function(x, y, larg, haut, col, colLine)
- {
- this._x = x;
- this._y = y;
- this.largeur = larg;
- this.hauteur = haut;
- this.colorBar = col;
- this.colorline = colLine;
- };
- PowerScrollBar = function()
- {
- super();
- };
- PowerScrollBar.prototype = new ScrollBar();
- Object.registerClass("PowerBarClip",PowerScrollBar);
- PowerScrollBar.prototype.onEnterFrame = function()
- {
- super.onEnterFrame();
- this.donnee = this._parent.vesso.power;
- };
- LifeScrollBar = function()
- {
- super();
- this.donneeMax = 1000;
- };
- LifeScrollBar.prototype = new ScrollBar();
- Object.registerClass("LifeBarClip",LifeScrollBar);
- LifeScrollBar.prototype.onEnterFrame = function()
- {
- super.onEnterFrame();
- this.donnee = this._parent.vesso.vie;
- };
- LifeBossScrollBar = function()
- {
- super();
- this.donneeMax = 5000;
- };
- LifeBossScrollBar.prototype = new ScrollBar();
- Object.registerClass("LifeBossBarClip",LifeBossScrollBar);
- LifeBossScrollBar.prototype.onEnterFrame = function()
- {
- super.onEnterFrame();
- this.donnee = this._parent.vie;
- };
- ScrollBar.prototype.traceContour = function()
- {
- this.lineStyle(2,this.colorline,50);
- var i = 0;
- while(i <= this.largeur)
- {
- this.moveTo(i,0);
- this.lineTo(i,this.hauteur);
- i += this.largeur / 10;
- }
- this.moveTo(0,0);
- this.lineTo(this.largeur,0);
- this.moveTo(this.largeur,this.hauteur);
- this.lineTo(0,this.hauteur);
- };
-