Hi, how do you change the background color of a textbox when a user clicks their mouse in it? or it gets focus?
any ideas??
Regards,
Martin
Gaming Help And Info:
any ideas??
Regards,
Martin
Gaming Help And Info:
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
textBox.onSetFocus = function() {
textBox.background = true;
textBox.backgroundColor = 0xff0000;
};
textBox.onKillFocus = function(){
textBox.backgroundColor=0xffffff;
}
//pass in the instance name of the text box
_global.setTextBox = function(textBox,mode){
if(mode == "on"){
textBox.background = true;
textBox.backgroundColor = 0xff0000;
}else if(mode == "off"){
textBox.backgroundColor = 0xffffff;
}
}
textBoxName.onSetFocus = _global.setTextBox("textBoxInstanceName","on");
textBoxName.onKillForcus = _global.setTextBox("textBoxInstanceName","off");