mrand01
07-14-2003, 02:00 PM
Heres my (current) problem: I need to take a variable from one flash movie, and transfer that variable to the next flash movie. (after user login is successfull, transfer the "username" variable to the next movie)
I've taken a look at my code, tutorials, etc, and can't find anything wrong with it, so help me out.
CODE FOR LOGIN PAGE (line that I think is wrong is labeled)
stop();
_global.flashData = new LoadVars();
login_btn.onRelease = function() {
username = user_txt.text;
password = password_txt.text;
flashData.username = _root.username;
flashData.password = _root.password;
flashData.sendAndLoad("http://localhost/onDemandTest/login.asp",flashData,"POST");
LoadStatus.text = "Loading";
}
flashData.onLoad = function() {
if(this.success == "True") {
//getURL("http://localhost/onDemandTest/index.asp","_self","POST");
getURL("http://localhost/onDemandTest/index.asp?username=" + flashData.username, "_self"); //Line that should be changed...
}
else if(this.success == "False") {
LoadStatus.text = "Login Incorrect";
}
else {
LoadStatus.text = "Loading";
}
}
ASP CODE (index.asp)
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<HTML>
<HEAD>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<TITLE>ondemand</TITLE>
</HEAD>
<BODY bgcolor="#000000">
<object id="FMClass1" width="974" height="718" classid="CLSID:637BB540-6ABA-11D4-901D-00D0090CB3BC" codebase="http://www.flashants.com/codebase/fmplayer.cab"#version=1,5,0,0">
<param name="LicenseKey" value="FMRCD-BEJDE-EZZAA-WQAKL-4Q77I-HRSAE">
<param name="SwfURL" value="http://localhost/OnDemandTest/ondemand_v4.swf?username=<%=username%>">
<embed src="http://localhost/OnDemandTest/ondemand_v4.swf?username=<%=username%>" pluginspage="http://www.flashants.com/download/download.shtml" type="application/x-FlashAnts-FMPLAYER" width="974" height="718">
</embed>
</object>
</BODY>
</HTML>
As you can see, I'm trying to load the variable with a string at the end of the URL (ondemand_v4.swf?username=<%=username%>), but it isn't working.
And last, here is my code for the receiving end.
myVars = new LoadVars();
myVars.onLoad = function() {
user_txt.text = username;
}
myVars.load("http://localhost/onDemandTest/index.asp");
Any help would be greatly appreciated.
I've taken a look at my code, tutorials, etc, and can't find anything wrong with it, so help me out.
CODE FOR LOGIN PAGE (line that I think is wrong is labeled)
stop();
_global.flashData = new LoadVars();
login_btn.onRelease = function() {
username = user_txt.text;
password = password_txt.text;
flashData.username = _root.username;
flashData.password = _root.password;
flashData.sendAndLoad("http://localhost/onDemandTest/login.asp",flashData,"POST");
LoadStatus.text = "Loading";
}
flashData.onLoad = function() {
if(this.success == "True") {
//getURL("http://localhost/onDemandTest/index.asp","_self","POST");
getURL("http://localhost/onDemandTest/index.asp?username=" + flashData.username, "_self"); //Line that should be changed...
}
else if(this.success == "False") {
LoadStatus.text = "Login Incorrect";
}
else {
LoadStatus.text = "Loading";
}
}
ASP CODE (index.asp)
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<HTML>
<HEAD>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<TITLE>ondemand</TITLE>
</HEAD>
<BODY bgcolor="#000000">
<object id="FMClass1" width="974" height="718" classid="CLSID:637BB540-6ABA-11D4-901D-00D0090CB3BC" codebase="http://www.flashants.com/codebase/fmplayer.cab"#version=1,5,0,0">
<param name="LicenseKey" value="FMRCD-BEJDE-EZZAA-WQAKL-4Q77I-HRSAE">
<param name="SwfURL" value="http://localhost/OnDemandTest/ondemand_v4.swf?username=<%=username%>">
<embed src="http://localhost/OnDemandTest/ondemand_v4.swf?username=<%=username%>" pluginspage="http://www.flashants.com/download/download.shtml" type="application/x-FlashAnts-FMPLAYER" width="974" height="718">
</embed>
</object>
</BODY>
</HTML>
As you can see, I'm trying to load the variable with a string at the end of the URL (ondemand_v4.swf?username=<%=username%>), but it isn't working.
And last, here is my code for the receiving end.
myVars = new LoadVars();
myVars.onLoad = function() {
user_txt.text = username;
}
myVars.load("http://localhost/onDemandTest/index.asp");
Any help would be greatly appreciated.