Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/09/2005, 09:52
Avatar de richardinj
richardinj
 
Fecha de Ingreso: enero-2005
Ubicación: Ciber Espacio
Mensajes: 2.180
Antigüedad: 19 años, 2 meses
Puntos: 11
Mensaje FLASH Y AJAX... no es la gran cosa , pero si muy util.. aca les doy un ejemplo....

no es la gran cosa.. ahi les va el codigo ...
hago una animacion que tenga un boton.. al dar click me sale el IP


Código HTML:
<script language="javascript"  type="text/javascript">
//crear el objeto
function objetus() {
        try {
                objetus = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
                try {
                        objetus= new ActiveXObject("Microsoft.XMLHTTP");
                } catch (E) {
                        objetus= false;
                }
        }
        if (!objetus && typeof XMLHttpRequest!='undefined') {
                objetus = new XMLHttpRequest();
        }
        return objetus
}

function enviar()
{
    
	_objetus=objetus()
    _values_send="funcion=ip";
    _URL_="dar_ip.php?"
    _objetus.open("GET",_URL_+_values_send,true);        
    _objetus.onreadystatechange=function() {              
        if (_objetus.readyState==4)
        {               
            window.alert(_objetus.responseText);
        }
    }   
    _objetus.send(null);
}
</script>

<input type='button' value='Ver IP' Onclick="javascript: enviar();"> 
ver_ip.php
Código PHP:
   <?php echo $_SERVER['REMOTE_ADDR']; ?>



Y el boton de flash debe tener esto

Código:
on(release)
{
  GetURL("javascript: enviar();");
}

Listo... flash y AJAX... es facil y muy bueno... se pueden hacer muchas cosas....


Comentarios.....

Última edición por richardinj; 09/09/2005 a las 12:03