Ultrashock Forums > Flash > ActionScript
Flash -> ASP -> MS Access

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
Flash -> ASP -> MS Access
Old 2008-03-14

Hey,

I am having a problem getting a variable from send from ASP to Flash. Everything else works i can actualy POST vars from flash to ASP the to ms Access but at the end of adding a new usr password and type i would like to check if i get back a value posted from asp. I have created something similar before and it works great. i just can not find whats wrong in this one. Any help at all would be great. Here is the ASP and AS2.0
Code:
<%	
Dim UserName, Password, usrType
UserName = trim(request("flaUser"))
usrPass = trim(request("flaPass"))
usrType = trim(request("flaType"))

Dim cn2
set cn2=Server.CreateObject("ADODB.Connection")
cn2.Provider="Microsoft.Jet.OLEDB.4.0"
DSNtemp = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("\Database\Somedata.mdb; User Id=Admin; Password=")
cn2.Open DSNtemp

SQLstmt = "INSERT INTO Users (UserName, usrPass, Type) VALUES ('" & UserName & "', '" & usrPass & "', '" & usrType & "')"

cn2.execute SQLstmt
cn2.close
set cn2 = nothing
'set SQLstmt = nothing

Dim mainMessage
mainMessage="message1=1"
response.Write(mainMessage)
%>
Code:
_root.btnAdd.onRelease = function() {
	var result_lv:LoadVars = new LoadVars();
	result_lv.onLoad = function() {
		if (this.message1 == "1") {
			
			_root.txtError.text = "Added";
		} else {
			_root.txtError.text = "Cound Not add record!!!!" + message1.text;
		}
	};
	var send_lv:LoadVars = new LoadVars();
	send_lv.flaUser = _root.txtUser.text;
	send_lv.flaType = _root.txtType.text;
	send_lv.flaPass = _root.txtPass.text;

	send_lv.sendAndLoad("addrow.asp",result_lv,"POST");
};
Thanks in advance
postbit arrow 1 comment | 360 views postbit arrow Reply: with Quote   
Registered User
carenot is offline
seperator
Posts: 75
2006-09-18
Age: 22
seperator

Ultrashock Member Comments:
carenot carenot is offline 2008-03-20 #2 Old  
Just in case anybody cares or comes accross the problem like this. here is how you can get flash to get those variables from ASP. just add & (and) sign in from of the var name.

ASP:
Code:
Dim mainMessage
mainMessage = "&flashVar=test123"
Response.Write(mainMessage)
Fla side:
ActionScript Code:
  1. var result_lv:LoadVars = new LoadVars();
  2.     result_lv.onLoad = function() {
  3.         trace(this.mainMessage);
  4.                          //output: test123
  5.         }else{
  6.         trace("did not load the message from ASP")
  7.         }
  8.     }
  9.     var send_lv:LoadVars = new LoadVars();
  10.     send_lv.sendAndLoad("aspFile.asp", result_lv, "POST");
  11.     }
  12. };
Reply With Quote  
Thread Tools
Display Modes Rate This Thread
Rate This Thread: