# Why doesn't this bit of code work?

**URL:** <https://forum.kirupa.com/t/why-doesnt-this-bit-of-code-work/229672>\
**Category:** flash\
**Created:** [June 19, 2007, 12:44pm UTC](https://forum.kirupa.com/t/why-doesnt-this-bit-of-code-work/229672 "2007-06-19T12:44:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcusbrunstrom](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@marcusbrunstrom](https://forum.kirupa.com/u/marcusbrunstrom)\
**Post date:** [June 19, 2007, 12:44pm UTC](https://forum.kirupa.com/t/why-doesnt-this-bit-of-code-work/229672/1 "2007-06-19T12:44:56Z")

</div>

As the header said, why doesn’t this work?

I want to use it as a login screen in flash to my ftp.

//This goes in frame actions  
function Login(user, pass, servers) {  
var cusername = user:String;  
var cpassword = pass:String;  
var cserver = servers:String;

```
     if (cusername == undefined) {
         status = "Please enter your username";
      } else {
                 if (cpassword == undefined) {
                      status = "Please enter your password";
                  } else {
                             if (cserver == undefined) {
                                  status = "Please enter the server";
                               } else {
                                         address = "ftp://"+cusername+":"+cpassword+"@"+cserver;
                                         getURL = (address, _blank);
                               username = "";
                               password = "";
                               }
                   }
         }

```

}

for the connect button:

on (Release) {  
\_root.login(username, password, server);  
}
