# F8 what's wrong with this code?

**URL:** <https://forum.kirupa.com/t/f8-whats-wrong-with-this-code/307047>\
**Category:** flash\
**Created:** [March 26, 2010, 6:20pm UTC](https://forum.kirupa.com/t/f8-whats-wrong-with-this-code/307047 "2010-03-26T18:20:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![capdetrons](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@capdetrons](https://forum.kirupa.com/u/capdetrons)\
**Post date:** [March 26, 2010, 6:20pm UTC](https://forum.kirupa.com/t/f8-whats-wrong-with-this-code/307047/1 "2010-03-26T18:20:41Z")

</div>

Hi,

can anyone see why this doesn’t work? The password\_txt textField doesn’t become visible with the function but trace works.

stop();  
this.createTextField(“username\_txt”, this.getNextHighestDepth(), 450, 235, 120, 20);

focusManager.defaultPushButton = login\_btn;  
username\_txt.setFocus();  
username\_txt.border = true;  
username\_txt.type = “input”;  
username\_txt.setFocus();  
username\_txt.maxChars = 15;

username\_txt.onChanged = function():Void {  
if (username\_txt.text == “Pucci”) {  
this.createTextField(“password\_txt”, this.getNextHighestDepth(), 450, 265, 120, 20);  
this.password\_txt.password = true;  
this.password\_txt.border = true;  
this.password\_txt.visible = true;  
this.password\_txt.type = “input”;  
trace("Text within the comments field = "+username\_txt.text);  
}  
};
