Dificultad
Con un poco de código actionScript podemos crear tooltips similares a los de las páginas HTML.
Función que muestra el tooltip
showToolTip = function (texto) {
toolTip_mc.texto.text = texto;
toolTip_mc._x = _xmouse;
toolTip_mc._y = _ymouse;
toolTip_mc._visible = true;
toolTip_mc.startDrag();
};
Función que esconde el toolTip
hideToolTip = function () {
toolTip_mc._visible = 0;
toolTip_mc.stopDrag();
};
Formato para el objeto TextField que vamos a crear
formato = new TextFormat(); formato.color = 0xff0000; formato.font = "verdana";
Creamos un clip de pelí cula.
this.createEmptyMovieClip("toolTip_mc", this.getNextHighestDepth());
this.toolTip_mc._visible = false;
Creamos un campo de texto dentro del clip de pelí cula.
this.toolTip_mc.createTextField("texto", this.getNextHighestDepth(), 10, -15, "", "");
this.toolTip_mc.texto.setNewTextFormat(formato);
Modificamos las propiedades del campo de texto
this.toolTip_mc.texto.border = true; this.toolTip_mc.texto.borderColor = 0x000000; this.toolTip_mc.texto.autoSize = true; this.toolTip_mc.texto.background = true; this.toolTip_mc.texto.backgroundColor = 0xffffff;
Ejemplo de uso
boton_mc.onRollOver = function() {
showToolTip("Hola mundo");
};
boton_mc.onRollOut = hideToolTip;
Septiembre 9th, 2004 at 12:19 am
Yo en cristalab hice un tutorial sobre ello hace tiempo, la dire: http://www.cristalab.com/vertutorial.php?id=55
El mio se parece más al de windows ajajjaja
(Joke
Septiembre 9th, 2004 at 12:38 am
Pues está muy bien, una cosa, esto: selectable = false;
¿pa que?
jua jua te he pillao
Ah! y el onEnterFrame lo podrás evitar con un setInterval.
saludos!
Septiembre 9th, 2004 at 9:23 am
Está muy bien, muy simple y útil. Me gusta.
Septiembre 9th, 2004 at 4:20 pm
Una manera rápida y sencilla. Y lo mejor de too dinámico, como a mi me gusta XDD.. mu wueno toni
Septiembre 9th, 2004 at 6:28 pm
Toni, has visto la clase de etiquetas que he hecho?
Si quieres ya te la pasare que está muy bien, jeje.
Un saludo!! ^^
Septiembre 9th, 2004 at 7:37 pm
Gracias Raul, ya me la he bajado.
Un saludo
Septiembre 9th, 2004 at 8:58 pm
Esta chulo
Septiembre 9th, 2004 at 9:04 pm
Raúl, ¿te has fijado en tu blog, que el texto de la derecha “Archivo:” se monta sobre el botón buscar?
Septiembre 13th, 2004 at 2:02 pm
Pues sí , pero sólo les pasa a los que entran con IE ¬¬ (no deberí as usar eso, caca, XD)
Intentaré arreglarlo a ver si funciona mejor, pero me lo he estado mirando y no se que está mal todaví a.
Un saludo!!
Octubre 22nd, 2004 at 7:23 pm
a mi me sale esto:
**Error** Symbol=mc_toolTip, layer=palo izquierda abajo, frame=1:Line 2: Type mismatch in assignment statement: found Number where Boolean is required.
_visible = 0;
estoy publicando mi trabajo en flash 6 as2
funciona el tooltip, pero me fastidia q salga el panel,….porq razon es?
Octubre 22nd, 2004 at 9:26 pm
Hola Alejandro
Cambia:
_visible = 0;
por
_visible = false
Saludos