3 Replies Latest reply on May 3, 2009 11:48 AM by Chunick

    Repeat Loop and variables


      Hi, at the minute I have the following code:


      on mouseUp
        loggedOn = false


        repeat with i = 1 to uid.length
          if sprite("userlogin").text = uid[i] and sprite("passlogin").text = uid[i] then
            loggedOn = true
          end if
        end repeat
        if loggedOn = true then
          alert("You have been logged in successfully")
          go to frame 116
          alert("There was a problem with your username or password")
        end if



      When I try to use 'uid.length' in the repeat with, it doesn't work, but if i replace it with a number such as 'repeat with i = 1 to 3' it will work.  'uid' is a list which changes depending on how many users are registered, so if there are 4 users it should go through it 4 times.  I think its a problem with the .length part, but I'm not sure how to fix it.