Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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 July 14th, 2003, 12:00 AM
jmichels's Avatar
jmichels jmichels is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Orlando, FL
Posts: 177 jmichels User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 18 m 12 sec
Reputation Power: 6
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

Reply With Quote
  #2  
Old July 14th, 2003, 04:31 PM
1ain 1ain is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Bath
Posts: 26 1ain User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #3  
Old July 14th, 2003, 06:39 PM
jmichels's Avatar
jmichels jmichels is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Orlando, FL
Posts: 177 jmichels User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 18 m 12 sec
Reputation Power: 6
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

Reply With Quote
  #4  
Old July 29th, 2003, 11:53 AM
1ain 1ain is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Bath
Posts: 26 1ain User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking

no probs dude!

...happy to help

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Field Changes


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway