Skip to main content
Inspiring
September 20, 2011
Answered

Type Here

  • September 20, 2011
  • 1 reply
  • 975 views

1. In my submit form, how do I display "Type Here" when a text field is blank? and when the user begins typing, how can make "Type Here" disappear?

2. if I have a button on the root, can I assign an onRelease action to it from _root.main_mc.sub_mc.holder_mc? I've tried but no luck. Is this possible?

This topic has been closed for replies.
Correct answer kglad

if your textfield has instance name tf, use:

tf.text="Type Here";

tf.onSetFocus=function(){

if(this.text=="Type Here"){

this.text="";

}

}

////////////////////////

if your button on the main timeline has instance name btn, you can use the following from any timeline, as long as your button exists when the code exectes:

_root.btn.onRelease=function(){

//whatever

}

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
September 20, 2011

if your textfield has instance name tf, use:

tf.text="Type Here";

tf.onSetFocus=function(){

if(this.text=="Type Here"){

this.text="";

}

}

////////////////////////

if your button on the main timeline has instance name btn, you can use the following from any timeline, as long as your button exists when the code exectes:

_root.btn.onRelease=function(){

//whatever

}

Inspiring
September 20, 2011

Thanks Kglad.

kglad
Community Expert
Community Expert
September 20, 2011

you're welcome.