A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Problem with Flash Contact Form

  1. #1
    Junior Member
    Join Date
    Mar 2009
    Posts
    9

    resolved Problem with Flash Contact Form

    Hi,
    In Flash (AS3) Iam creating a contact form in that i have taken one " Submit Button" , one " Reset Button", four input text fields
    " Name, Email, Subject, Message" with instance names " contact_name, contact_email, contact_subject, contact_message"

    Iam very much confused about setFocus and killFocus.

    In AS3, i have given

    contact_name.text = "Name";
    contact_email.text= "Email";
    contact_subject.text = "Sub";
    contact_message.text = "Message";

    Now when i publish this file, bydefault the input text field shows with text
    "Name, Email, Sub, Message"

    Now my requirement is if i click on Name Field so the text "Name" should get disappear so that i can enter my name, after that i click on Email field
    the text "Email" should get disappear at the same time i don't want to lose my Name which is entered in Name Field.

    If i click in Subject text Field the text "Sub" should get disappear but not to lose the Name and Email data entered by me.

    If i click in Message text Field the text "Message" should get disappear but i don't want to lose the data which was entered in remaining text fields.

    Please find the attachment so that you can have an idea.
    Please help me to find the solution.
    Attached Files Attached Files

  2. #2
    Junior Member
    Join Date
    Jul 2008
    Location
    Orlando, FL
    Posts
    10
    Could you not do something like
    Code:
    function clearText(event:MouseEvent):void {
    	if(contact_name.text == "Name") {
    		contact_name.text = "";
    	}
    }
    contact_name.addEventListener(MouseEvent.CLICK, clearText);

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center