|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Field Changes
Greetings,
This is an issue that I have been having for quite sometime and I have never seen a tutorial written on this subject. If you go to http://disney.go.com/disneypictures/pirates/index.html and click on the gallery, then "Send to yer mate." There you will notice a form whose fields change once you click on them. One can easily create an empty field with an onSetFocus action, but this looks much more advanced because these fields react to one another. Any help would be greatly appreciated. Thank you. Sincerely, Jamie Michels www.thedarkcontent.com |
|
#2
|
|||
|
|||
|
dude,
it could be much simpler than you think. create 3 text boxes, typing something into all of them, say "these pirates be ere already!" and "argh, that it be!". then you create an onsetfocus function for each text box which sets the textfield to "" (when on focus)...this will clear the existing content. ...then, do this- use an onkillfocus event handler for each textbox, which sets the text value back to what it was originally, for example, textbox_1.onkillfocus = function () { textbox_1.text = "these pirates be ere already!"; } textbox_2.onkillfocus = function () { textbox_2.text = "argh, that it be!"; } and that's it! you could go one step further, storing these default text values in an array an accessing them depending on the name of the textbox which you are interested....or something. hope this helps. |
|
#3
|
||||
|
||||
|
Thank you very much for your help, I appreciate it! The onKillFocus function had eluded me for quite a while. I've added some snippet of actionscript below that enhances the previous reply if anyone is having similar issues:
field1.onSetFocus = function() { if (field1.text == "Name") { field1.text = ""; } }; field1.onkillfocus = function() { if (field1.text == "") { field1.text = "Name"; } }; field2.onSetFocus = function() { if (field2.text == "Email") { field2.text = ""; } }; field2.onkillfocus = function() { if (field2.text == "") { field2.text = "Email"; } }; field3.onSetFocus = function() { if (field3.text == "Message") { field3.text = ""; } }; field3.onkillfocus = function() { if (field3.text == "") { field3.text = "Message"; } }; Sincerely, Jamie Michels www.thedarkcontent.com |
|
#4
|
|||
|
|||
|
no probs dude!
...happy to help ![]() |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Field Changes |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|