3 Replies Latest reply on Nov 24, 2010 9:51 AM by Sean_Wilson

    Strange error in compiling

    Hosseinrostamzadeh Level 1

      Please help, this gets me MAD!!!

       

      When I run this code every thing goes normally, It means that I can access all variables later in the movie.

       

      on mouseUp me
       
        global  usrName,usrSurName, password


      -- 
      --  if sprite("usrNameTF").text = "" or sprite("usrSurNameTF").text = "" or sprite("passwrdTF").text = ""  then
      --    alert("Fill alle fields to continue!")
      --    go to the frame
      --  else
      --    go to frame "menu"
      --  end if

       
        usrName = sprite("usrNameTF").text
        usrSurName = sprite("usrSurNameTF").text
        password = sprite("passwordTF").text
       
      end

       

      BUT when  I uncomment the commented section above(because I need it) I get error, where it says PROPERTY NOT FOUND ........... # text

      It simply does not accept a sprite to have a property named "text"

       

      What is wrong with this section??

      why it does not annoy with three last lines where I use the same concept i.e.  sprite("usrNameTF").text ???? here the text property causes no problem and works as it is designed.

      Any help is appreciated.

      Best regards!

      HR

        • 1. Re: Strange error in compiling
          Sean_Wilson Adobe Community Professional

          I suspect it's a typo. Your top code asks for sprite("passwrdTF").text while below you refer to sprite("passwordTF").text - do you see the difference?

          Try the following modification:

          on mouseUp me
            
            global  usrName,usrSurName, password
            
            tUsername = sprite("usrNameTF").text
            tSurname = sprite("usrSurNameTF").text
            tPassword = sprite("passwordTF").text
            
            if tUsername = "" or tSurname = "" or tPassword = ""  then
              alert("Fill alle fields to continue!")
            else
              usrName = tUsername
              usrSurName = tSurname
              password = tPassword
              go to frame "menu"
            end if
            
          end
          
          • 2. Re: Strange error in compiling
            Hosseinrostamzadeh Level 1

            Thank you Sean!

             

            Your suggestion helped.

             

            But I still do not get the point why

             

            if sprite("passwordTF").text = "" then

            .....

            ...

            end if

            should cuase an error in compiling at all??

             

            The exchange between passwrd and password in

            sprite("passwrdTF").text

            was just typing error.

             

             

            Best regards!

            HR

             

             


            • 3. Re: Strange error in compiling
              Sean_Wilson Adobe Community Professional

              I thought it was a runtime error you were seeing, not a compiler error.