Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/05/2010, 18:14
Avatar de Ranya
Ranya
 
Fecha de Ingreso: marzo-2010
Mensajes: 10
Antigüedad: 14 años, 2 meses
Puntos: 0
Problema con mi control de volumen

Hola, como estan amigos miren tengo un problema con mi barra de volumen es que quiero que aparezca por defecto en 50% del volumen peor no logro hacerlo estoy algo confundida porfa ayudenme aqui les dejo lo que tengo.



Código Actionscript:
Ver original
  1. #initclip 50
  2. function mcVolumeControl()
  3. {
  4.     this.onLoad = this.on_load;
  5. } // End of the function
  6. mcVolumeControl.prototype = new MovieClip();
  7. mcVolumeControl.prototype.on_load = function ()
  8. {
  9.     if (this.xo != undefined)
  10.     {
  11.         this._x = this.xo;
  12.     } // end if
  13.     if (this.yo != undefined)
  14.     {
  15.         this._y = this.yo;
  16.     } // end if
  17.     if (this.so != undefined)
  18.     {
  19.         this._xscale = this._yscale = this.so;
  20.     } // end if
  21.     if (this.color != undefined)
  22.     {
  23.         var color = new Color(this.mc_speaker);
  24.         color.setRGB(this.color);
  25.         var color = new Color(this.mc_bar);
  26.         color.setRGB(this.color);
  27.         var color = new Color(this.mc_border);
  28.         color.setRGB(this.color);
  29.         var color = new Color(this.txt_volume);
  30.         color.setRGB(this.color);
  31.     } // end if
  32.     if (this.shadow != undefined)
  33.     {
  34.         var _loc3 = new flash.filters.DropShadowFilter(this.shadow.distance, this.shadow.angle, this.shadow.color, 8.000000E-001, 5, 5);
  35.         this.filters = [_loc3];
  36.     } // end if
  37.     if (this.show_percent == false)
  38.     {
  39.         this.txt_volume._visible = false;
  40.     } // end if
  41.     this.global_sound = new Sound();
  42.     this.mc_bar.setMask(this.mc_mask);
  43.     this.goto_level = this.global_sound.getVolume();
  44.     if (this.vo != undefined)
  45.     {
  46.         this.goto_level = this.vo;
  47.         this.global_sound.setVolume(this.vo);
  48.     } // end if
  49.     this.onEnterFrame = this.on_enter;
  50.     this.mc_speaker.onRelease = function ()
  51.     {
  52.         if (this._parent.vol_level > 0)
  53.         {
  54.             this.old_volume = this._parent.vol_level;
  55.             var _loc2 = 0;
  56.         }
  57.         else if (this.old_volume == undefined)
  58.         {
  59.             _loc2 = 50;
  60.         }
  61.         else
  62.         {
  63.             _loc2 = this.old_volume;
  64.         } // end else if
  65.         this._parent.goto_level = _loc2;
  66.     };
  67.     this.mc_border.onPress = function ()
  68.     {
  69.         this.is_press = true;
  70.     };
  71.     this.mc_border.onRelease = this.mc_border.onReleaseOutside = function ()
  72.     {
  73.         this.is_press = false;
  74.     };
  75.     this.mc_border.onEnterFrame = function ()
  76.     {
  77.         if (this.is_press == true)
  78.         {
  79.             var _loc2 = Math.max(this._parent.mc_bar._xmouse + 1, 0);
  80.             var _loc3 = this._parent.mc_bar._width;
  81.             _loc2 = Math.min(_loc2, _loc3);
  82.             _loc2 = 100 * _loc2 / _loc3;
  83.             this._parent.goto_level = _loc2;
  84.         } // end if
  85.     };
  86. };
  87. mcVolumeControl.prototype.on_enter = function ()
  88. {
  89.     this.vol_level = this.global_sound.getVolume();
  90.     var _loc2 = this.goto_level - this.vol_level;
  91.     if (Math.abs(_loc2) > 5)
  92.     {
  93.         this.vol_level = this.vol_level + _loc2 / 4;
  94.     }
  95.     else
  96.     {
  97.         this.vol_level = this.vol_level + _loc2;
  98.     } // end else if
  99.     this.mc_mask._xscale = this.vol_level;
  100.     var _loc3 = Math.round(this.vol_level);
  101.     this.txt_volume.text = _loc3;
  102.     this.mc_speaker.mc_wave_3._visible = this.vol_level > 66;
  103.     this.mc_speaker.mc_wave_2._visible = this.vol_level > 33;
  104.     this.mc_speaker.mc_wave_1._visible = this.vol_level > 0;
  105.     this.global_sound.setVolume(Math.round(this.vol_level));
  106. };
  107. Object.registerClass("mcVolumeControl", mcVolumeControl);
  108. #endinitclip

Profa ayudenme no entindo mucho de este lenguaje...