Hi. I am following an example from a book that shows you how to create a flash
front end quiz with asp.net and sql server databse. I am using flash MX 2004,
visual basic 2003 & MS SQL server 2000. I am having problem connecting the user
registration from the flash end. It just doesn't seem to do anything even
though I have copied the code exactly as it says in the book(Building database
driven flash application).

The user choose to register and enters their username and password then clicks
a register button. this then goes to another frame that has a movie clip and
the following code behind it:

onClipEvent(load) {
_root.done = 0;
//call aspx page to register new player

_root.loadVariables("Register.aspx?PlayerName="+_r oot.strUsername+"&Password="
+_root.str
Password);
startTime = getTimer();
}

onClipEvent(enterFrame) {
//check for timeout
if ((getTimer() - startTime)/1000 < _root.TimeoutLength) {
if (_root.done=="1") {
//if aspx returned an error send to error screen
if (_root.Error != "") {
_root.strReturn = "initialize2";
_root.gotoAndStop("error");
} else {
//if all is successful sent to question
_root.gotoAndStop("question");
}
}
} else {
_root.error = "The server timed out while trying to register your
information. Please press OK below to try again.";
_root.strReturn = "register";
_root.gotoAndStop("error");
}
}

In the register aspx page that it calls the code is as follows:
Public Class Register
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub

'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load

Dim objCMD As New SqlClient.SqlCommand
Dim objConn As New SqlClient.SqlConnection
Dim objDR As SqlClient.SqlDataReader
Dim strSQL As String
Dim blnResult As Boolean

Response.Write("dummy=1")

' Set the connection
objConn.ConnectionString = Application("strConn")

' Open the connection
objConn.Open()

' Set the command connection
objCMD.Connection = objConn

' See if an existing player with the same name exists
strSQL = "select idPlayer from Players where PlayerName= '" & _
Replace(Request.QueryString("PlayerName"), "'", "''") & "'"

' Set the command query
objCMD.CommandText = strSQL

' Set the reader
objDR = objCMD.ExecuteReader

' Get the data and see if anything is returned
blnResult = objDR.Read

' If no data returned
If blnResult = False Then

' Build a SQL statement to insert the new player
strSQL = "insert into Players(PlayerName, Password) values('" & _
Request.QueryString("PlayerName") & "', '" & _
Request.QueryString("Password") & "')"

' Set the command query
objCMD.CommandText = strSQL

' Close the reader
objDR.Close()

' Execute the query
objCMD.ExecuteNonQuery()

strSQL = "select idPlayer from Players where PlayerName= '" & _
Replace(Request.QueryString("PlayerName"), "'", "''") & _
"' and Password = '" & _
Replace(Request.QueryString("Password"), "'", "''") & "'"

' Set the command query
objCMD.CommandText = strSQL

' Set the reader
objDR = objCMD.ExecuteReader

' Get the result of the read
blnResult = objDR.Read

' If no results, then there is no player match
If blnResult = False Then
Response.Write("&Error=There was an error registering " & _
"your information.")
Else
' There is a match, store the player ID and
' send the user to the triva home page
Session("idPlayer") = objDR.Item("idPlayer")
End If

Else

' Indicate there is a user with the name already
Response.Write("&Error=The Player Name you selected " & _
"has already been taken.")

End If

Response.Write("&done=1")

End Sub

End Class


The flash movie is embeded into a page called default.aspx
Can any see anything major that im doing wrong here? Maybe there is some sort
of problem with the flash accessing the asp pages. I am not sure. I am new to
this and finding it difficult. Hope someone can help me. Thanks In advance.

Lyndsey x

onClipEvent(load) {
_root.done = 0;
//call aspx page to register new player

_root.loadVariables("Register.aspx?PlayerName="+_r oot.strUsername+"&Password="
+_root.str
Password);
startTime = getTimer();
}

onClipEvent(enterFrame) {
//check for timeout
if ((getTimer() - startTime)/1000 < _root.TimeoutLength) {
if (_root.done=="1") {
//if aspx returned an error send to error screen
if (_root.Error != "") {
_root.strReturn = "initialize2";
_root.gotoAndStop("error");
} else {
//if all is successful sent to question
_root.gotoAndStop("question");
}
}
} else {
_root.error = "The server timed out while trying to register your
information. Please press OK below to try again.";
_root.strReturn = "register";
_root.gotoAndStop("error");
}
}