Mirad tengo el siguiente problema o duda, llamarlo como querais.
Estoy pasando mi Web de formato html,asp a flash
y estoy un poco perdido en el apartado de login "del flash"
El Asp lo tengo funcionado con el formulario "usuario, password" que tiene el mismo, lo unico seria que pudiera acceder desde el formulario de flash
Actualmente este es el codigo que tengo en la pagina asp para hacer el login
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="grup90.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #D5EAFD;
}
.Estilo2 {color: #FFFFFF}
.Estilo6 {font-family: Verdana, Arial, Helvetica, sans-serif}
-->
</style>
</head>
<body><%
usuario=Request.Form("usuario")
password=Request.Form("password")
if password="" then password="kilimanjaro"
Set Conn = Server.CreateObject("ADODB.Connection")
DSNtest="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtest=dsntest & "DBQ=" & Server.MapPath("/Data/usuarios.mdb")
Conn.Open DSNtest
sql="SELECT * FROM usuarios WHERE usuario='"&usuario&"'"
set objRS=Conn.Execute(sql)
tipoagente="inicio"
if not ( objRS.BOF=true) and not(objRS.EOF=true) then
if( password =objRS("password")) then
if(objRS("seccion")="n") then
tipoagente="../preusnac/index.asp"
end if
if(objRS("seccion")="i") then
tipoagente="../preusint/index.asp"
end if
response.write "<form name=""salto"" method=""post"" action="""&tipoagente& """>"
response.write "<input type=""hidden"" name=""jvbtrds"" value=""klxxcvbc"">"
response.write "<input type=""hidden"" name=""ACCION"" value=""entrar"">"
response.write "</form>"
response.write"<script language=""javascript"">document.salto.submit();</script>"
end if
end if
%>
<%if tipoagente="inicio" then%>
<table width="772" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#D5EAFD">
<tr>
<td width="20" rowspan="3"><table width="20" height="100%" border="0" cellpadding="0" cellspacing="0" background="motiuesq.gif">
<tr>
<td> </td>
</tr>
</table></td>
<td width="732" height="77" valign="top" bgcolor="#FFFFFF"><table width="733" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="732"><img src="caps.jpg" width="732" height="58"></td>
</tr>
<tr>
<td></td>
</tr>
</table></td>
<td width="20" rowspan="3" background="img_web/motiudret.gif"> </td>
</tr>
<tr>
<td width="732" height="100%" align="left" valign="top" bgcolor="#FFFFFF"><div align="center">
<p> </p>
</div>
<form name="validar" action="index.asp" method="post">
<div align="center"> <span class="Estilo2">.......</span><span class="Estilo6">AGENTE</span> <input name="usuario" type="text" >
<br>
<p>
<span class="Estilo6">PASSWORD</span>
<input type="password" name="password">
<br>
</p>
<p><span class="Estilo2">............</span>
<input type="button" name="enviar" value="Aceptar" onClick="document.validar.accion.value='consultar';document.validar.submit()">
<input type="hidden" name="accion">
</p>
</div>
</form>
<div align="center"><img src="Areaprivada.jpg" width="732" height="334"></div></td>
</tr>
<tr>
<td width="732" height="100%" valign="bottom" bgcolor="#FFFFFF"><div align="center"><img src="base.gif" width="732" height="18" border="0" align="absmiddle" usemap="#Map">
</div></td>
</tr>
</table>
<%end if%>
</body>
</html>
<%
objRS.Close
Set objRS = Nothing
Conn.Close
Set Conn= Nothing
%>
Y el codigo del flash con el que estoy haciendo pruebas pero no acabo de hacerlo funcionar es este.
(esto esta situado en el primer frame)
stop ();
var envio:LoadVars = new LoadVars();
var recibir:LoadVars = new LoadVars();
function login() {
envio.usuario = usuario_txt.text;
envio.password = password_txt.text;
envio.action = "login";
envio.sendAndLoad("http://www.grup90.net/httpdocs/agentes/index2.asp", recibir, "POST");
}
recibir.onLoad = function(exito) {
if (exito) {
switch (this.opcion) {
case "0" :
mensaje_txt.text = "no existe el usuario";
break;
case "1" :
mensaje_txt.text = "nombre de usuario o pass mal ingresado";
break;
case "2" :
mensaje_txt.text = "datos correctos";
//acá pueden agregar acciones para los registrados
break;
default :
mensaje_txt.text = "no hay conexión";
break;
}
} else {
mensaje_txt.text = "Error en el Script";
}
};
Haber si me podeis hechar una mano, ha enlazar el flash con el asp.
Gracias