Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 8th, 2002, 08:05 AM
Nickbee Nickbee is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 15 Nickbee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ActionScript 2 - 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

Reply With Quote
  #2  
Old March 8th, 2002, 09:09 AM
TotalMonkey TotalMonkey is offline
Polynesian Monkey God
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Location: Monkeytown, USA
Posts: 57 TotalMonkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 28 m 46 sec
Reputation Power: 12
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

Reply With Quote
  #3  
Old April 1st, 2002, 04:10 PM
mbritton72 mbritton72 is offline
Shrill Digital God
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Raleigh, NC
Posts: 64 mbritton72 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m
Reputation Power: 12
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.

Reply With Quote
  #4  
Old April 1st, 2002, 04:32 PM
TotalMonkey TotalMonkey is offline
Polynesian Monkey God
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Location: Monkeytown, USA
Posts: 57 TotalMonkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 28 m 46 sec
Reputation Power: 12
If that's the way to go, just make sure that you include :
Code:
on (release, mouseover) { 
  if (textVarName ne "") {
    textVarName = " "; 
  }
}
...or something else to keep from clearing the textbox every time it's clicked on, unless that's what you want.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > ActionScript 2 - How to make an input box clear when clicked

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap