Hi, no problem, here is a simple version:
PHP Code:onFrame(2){
stop()
function setStyle(a,b,c){
a._text.border = true;//Set border to true for the text field to fill out.
a._text.background=true ;//Set background = true.
a._text.backgroundColor = 0xB35604;//Set the background color to orange.
a._text.borderColor = 0xFF0000;//Set the border color to orange.
a._text.textColor = 0xCCCCCC;//Set the text color to black.
a._text.password=c//c = true or false for password mode.
a.text=""//Empty the textfield if it has data.
b._x=a._x//Reposition the overlay text.
b._y=a._y
}
setStyle(_root.main.login.username_txt,_root.main.login.username_overlay,false)//Set style for username_txt to fill, the overlay with the form data, & password mode = true or false.
setStyle(_root.main.login.password_txt,_root.main.login.password_overlay,true);//Set style for username_txt to fill, the overlay with the form data, & password mode = true or false.
var keyListener:Object = new Object();
keyListener.onKeyUp = function() {//When the key is released, update visibility of the form fill text.
if(_root.main.login.username_txt.text.length!=0){//If the username text field is not empty, set the form fill to invisible.
_root.main.login.username_overlay._visible=false//Set the form fill to invisible.
}else if(_root.main.login.username_txt.text.length==0){
_root.main.login.username_overlay._visible=true//Set form fill to visible if the textfield is empty.
}
if(_root.main.login.password_txt.text.length!=0){//Repeat the same process for the password textfield.
_root.main.login.password_overlay._visible=false
}else if(_root.main.login.password_txt.text.length==0){
_root.main.login.password_overlay._visible=true
}
};
Key.addListener(keyListener);
}
download v2 (swish)




Reply With Quote