Action Script 2 Básico (4).

En este artículo se exploran distintas posibilidades de la función getURL().Para descomprimir el archivo con la fuente (.fla) se necesita el programa 7-zip

Indice.

1.- Demo.

Distintas acciones con getURL() : abrir url en una ventana nueva; abrir url en un iframe; mandar un correo; usar javascript.

[ Descargar .fla (5.7KB) ]


2.- Código AS.

En la capa de acciones están los manejadores de los distintos eventos para los cuatro botones.

stop();

//eventos boton 1
var mensaje = "Pulse un boton";
boton1.onRollOver = function() {
aviso.text = "Google en nueva ventana";
};
boton1.onRollOut = function() {
aviso.text = mensaje;
};
boton1.onRelease = function() {
getURL("http://google.es", "_blank");
};
//eventos boton 2
boton2.onRollOver = function() {
aviso.text = "Google en iframe";
};
boton2.onRollOut = function() {
aviso.text = mensaje;
};
boton2.onRelease = function() {
getURL("http://google.es", "inlineframe");
};
//eventos boton 3
boton3.onRollOver = function() {
aviso.text = "Mandame un correo";
};
boton3.onRollOut = function() {
aviso.text = mensaje;
};
boton3.onRelease = function() {
getURL("mailto:ja_lopezl@yahoo.es");
};
//eventos boton 4
boton4.onRollOver = function() {
aviso.text = "Google en pop-up";
};
boton4.onRollOut = function() {
aviso.text = mensaje;
};
boton4.onRelease = function() {
getURL("javascript:popup()");
};



Añadir a Favoritos Internet Explorer

Menú

Categorías


Lo Último

  Mis programas  Matemáticas  Geometría  Programación WEB  Flash MX  Variados
Dedicado a ANGELES y a RAMON.
Realizado por José Antonio López Lorenzo (JALL)
Vigo - Galicia - España -Europa