|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to make an input box clear when clicked
I have a search input box with the initial text of “Search Products”.
I’d like this text to disappear when the user clicks the box so he is set to enter his search. I tried the approach with a movie clip and an invisible button on the initial fame. When the user clicks the box it clears the text variable but he has to click one more time on the text box to get a cursor. Is there a one-click approach that will clear the text and have the cursor ready to go? See what I did so far at: http://www.tdipower.com/2002 Thanks |
|
#2
|
|||
|
|||
|
You could make the textbox a movieclip and then create an onClipEvent hit test routine that checks to see if the mouse is inside the textbox's movieclip when the mouse button is clicked (and clear the textbox if it is).
But there ought to be an easier way.
__________________
"We're all - monkeys!" -- Jeffrey Goines, 12 Monkeys |
|
#3
|
|||
|
|||
|
Maybe put a button underneath the text box. If the text box has a variable name, telling the button to make that variable = " " should do it.
on (release, mouseover) { textVarName = " "; }
__________________
I'm not impatient, I just have a low tolerance for boredom. |
|
#4
|
|||
|
|||
|
If that's the way to go, just make sure that you include :
Code:
on (release, mouseover) {
if (textVarName ne "") {
textVarName = " ";
}
}
|
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > How to make an input box clear when clicked |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|