I’ve implemented an Atomz search and want the text field (that has the default text=“search”) to clear itself on receiving focus.
IMPORTANT - it MUST work on a click OR when tabbing into it.
I’m using an input text field.
I’ve implemented an Atomz search and want the text field (that has the default text=“search”) to clear itself on receiving focus.
IMPORTANT - it MUST work on a click OR when tabbing into it.
I’m using an input text field.
OK, since I stumped everyone - or since no one cared, here’s how I got it to work:
I put this on frame 1
//set the default text/prompt
var urlSearch = “Search”;
//continuously check for focus and clear text if it = ‘search’
this.onEnterFrame = function(){
if (Selection.getFocus()== “_level0.SearchHolder.search”) {
if (_root.urlSearch == "Search") {
_root.urlSearch = ""; }
}
}
‘SearchHolder’ was a button instance in side of which was an input text field with instance name ‘search’.
That’s 1 for me, a few thousand for Kirupa. Now I’m on a roll.
Nice job!
this.onMouseUp = function(){
eval(Selection.getFocus()).text = “”;
}
:: Copyright KIRUPA 2024 //--