dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Login Page

  1. #1
    Junior Member
    Join Date
    Jun 2002
    Posts
    26

    Smile

    I'm creating a login page using Flash MX and ASP.Net. The coding works except for this one:
    if (typeof (valid)<>"undefined") {
    blah = valid;
    if (valid == 0) {
    gotoAndStop(4);
    } else {
    gotoAndStop(3);
    }
    }
    if (Submit<>true) {
    stop();
    }

    There isn't any syntax errors and it works except for the fact that it skips : if (valid == 0){
    gotoAndStop(4);
    Why is it skipping that statement?

  2. #2
    Senior Member
    Join Date
    Aug 2001
    Location
    Egypt
    Posts
    332
    try to put a trace action in your if statement, and make sure that your valid variable is a number and not a string....

  3. #3
    Junior Member
    Join Date
    Jun 2002
    Posts
    26

    Smile

    There is no errors on the asp page or flash. I did have the valid variable as a string so I changed it and it still does the same thing.

    Here is the coding for the asp page:
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


    Dim ID As String
    Dim Pass As String

    ID = Request.Form("Username")
    Pass = Request.Form("Password")

    If ID = "" Or Pass = "" Then
    Response.Write("valid=" & 0)
    Else
    Dim cn As OleDb.OleDbConnection = New OleDb.OleDbConnection("Provider=SQLOLEDB;Persist Security Info=false;User ID=sa;Password=rap2000;Initial Catalog=Northwind;Data Source=Slade")
    Dim cmd As OleDb.OleDbCommand = New OleDb.OleDbCommand("", cn)
    Dim param As OleDb.OleDbParameter



    cmd.CommandType = CommandType.StoredProcedure
    cmd.CommandText = "spAssassins"

    cmd.Parameters.Add(New OleDb.OleDbParameter("@ID", OleDb.OleDbType.VarChar))
    cmd.Parameters.Add(New OleDb.OleDbParameter("@Pass", OleDb.OleDbType.VarChar))
    cmd.Parameters.Add(New OleDb.OleDbParameter("@Valid", OleDb.OleDbType.Integer))

    cmd.Parameters("@Valid").Direction = ParameterDirection.Output
    cmd.Parameters("@ID").Value = ID
    cmd.Parameters("@Pass").Value = Pass


    cn.Open()
    cmd.ExecuteNonQuery()

    Response.Write("valid=" & cmd.Parameters("@Valid").Value)
    cn.Close()


    End If

    End Sub

  4. #4
    Junior Member
    Join Date
    Jun 2002
    Posts
    26

    Smile

    Nevermind, I have figured it out! Yippeeeee!
    I guess in Flash MX they have changed somethings around. Instead of having:
    if (valid == 0) {
    gotoAndStop(4);
    } else {
    gotoAndStop(3);
    }
    }

    You need to have:
    if (parseInt(valid) == 1) {
    gotoAndStop(3);
    } else {
    gotoAndStop(4);
    }

    Because, in Flash MX, for some odd reason, you have to convert it to a integer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center