• Lunes 29 de Abril de 2024, 01:02

Autor Tema:  Tooltip En Menú Slider ?  (Leído 1428 veces)

fastlane

  • Nuevo Miembro
  • *
  • Mensajes: 2
    • Ver Perfil
Tooltip En Menú Slider ?
« en: Martes 27 de Diciembre de 2005, 15:19 »
0
El tooltip lo he hecho de la siguiente manera:
Creando un archivo .as (actionscript) y colocando el siguiente codigo:
Código: Text
  1.  
  2. function init() {
  3.   _root.c = _root.getNextHighestDepth();
  4.   _root.createEmptyMovieClip("tooltip", _root.c);
  5.   _root.tooltip.createTextField("alt", _root.c+3, 0, 0, 10, 10);
  6.   with (_root.tooltip.alt) {
  7.   autoSize = true;
  8.   border = false;
  9.   background = false;
  10.   backgroundColor = (0x666666);
  11.   html = true;
  12.   selectable = false;
  13.   }
  14.   _root.formato = new TextFormat();
  15.   _root.formato.color = "0xffffff";
  16.   _root.formato.bold = false;
  17.   _root.formato.font = "FFF Galaxy";
  18.   _root.formato.size = "8";
  19.   _root.tooltip.createEmptyMovieClip("sombra", _root.c+1);
  20.   _root.tooltip.createEmptyMovieClip("fondo", _root.c+2);
  21.   _root.tooltip._visible = false;
  22. }
  23. function cambia(texto) {
  24.   _root.tooltip._x = _xmouse+4;
  25.   _root.tooltip._y = _ymouse-24;
  26.   _root.tooltip.onEnterFrame = function() {
  27.   _root.tooltip._x = _xmouse+4;
  28.   _root.tooltip._y = _ymouse-24;
  29.   };
  30.   _root.tooltip.alt.text = texto;
  31.   _root.tooltip.alt.setTextFormat(_root.formato);
  32.   with (_root.tooltip.sombra) {
  33.   clear();
  34.   ancho = _root.tooltip.alt._width;
  35.   alto = _root.tooltip.alt._height;
  36.   beginFill(0x000000, 30);
  37.   moveTo(0, 0);
  38.   lineTo(ancho+3, 0);
  39.   lineTo(ancho+3, alto+3);
  40.   lineTo(16, alto+3);
  41.   lineTo(0, alto+7);
  42.   lineTo(0, alto+3);
  43.   lineTo(0, 0);
  44.   endFill();
  45.   _x = 0;
  46.   _y = 0;
  47.   }
  48.   with (_root.tooltip.fondo) {
  49.   clear();
  50.   ancho = _root.tooltip.alt._width;
  51.   alto = _root.tooltip.alt._height;
  52.   lineStyle(1, 0xffffff, 100);
  53.   beginFill(0x006699, 50);
  54.   moveTo(0, 0);
  55.   lineTo(ancho, 0);
  56.   lineTo(ancho, alto);
  57.   lineTo(15, alto);
  58.   lineTo(-2, alto+6);
  59.   lineTo(0, alto);
  60.   lineTo(0, alto);
  61.   lineTo(0, 0);
  62.   endFill();
  63.   _x = 0;
  64.   _y = 0;
  65.   }
  66.   _root.tooltip._visible = true;
  67. }
  68. function para() {
  69.   delete _root.tooltip.onEnterFrame;
  70.   _root.tooltip._visible = false;
  71. }
  72.  
  73.  
Luego en la linea de tiempo de la pelicula colocando el siguiente codigo:
Código: Text
  1.  
  2. #include "tooltip.as"
  3. /// inicio de la funcion de "tooltip" ///
  4. init();
  5.  
  6.  
Luego en cada boton colocando el siguiente codigo:
Código: Text
  1.  
  2. on(rollOver){
  3. cambia(" Tu Texto Aqui ");
  4. }
  5. on(rollOut){
  6. para();
  7. }
  8.  
  9.  

Lo del menu slider lo he hecho siguiendo los pasos de un tutorial presente en esta web:
Pagina de Tutorial Menu Slider
En la seccion Menus => Menu_Slider

Aqui dejo el .fla que he tratado de desarrollar para darme a entender mejor:
Ejercicio

Gracias, Hasta Luego