A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: Input text box doesn't work within movieclip

  1. #1
    Senior Member
    Join Date
    Oct 2005
    Posts
    157

    Question Input text box doesn't work within movieclip

    Hello,

    I made a contact form in my flash website, but for some reason, you can't type in the input text boxes I made. I already have embedded the text, so that isn't the problem. I think maybe it's related to the code I have, or maybe I need a code to target the text box.

    One more key detail: The text box is within a movieclip. If I don't put it in the movieclip, it works fine, but I need it inside of the movieclip.

    I would appreciate it if you could take a look at my file here:
    https://rapidshare.com/files/3964236..._website11.zip

    Thanks in advance,
    SK

  2. #2
    Senior Member
    Join Date
    Jan 2009
    Posts
    208
    Just a wild guess, maybe you movieclip or other element inside, is somehow blocking the textbox.

  3. #3
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    It's possible the movieclip has mouseChildren set to false.

  4. #4
    Senior Member
    Join Date
    Oct 2005
    Posts
    157
    I dont believe it does. I would really appreciate it if you could take a quick look at my file I just can't seem to find the solution sadly.

    Thanks,
    SK

  5. #5
    Senior Member
    Join Date
    Jan 2009
    Posts
    208
    download link doesnt work.

  6. #6
    Senior Member
    Join Date
    Oct 2005
    Posts
    157

  7. #7
    Senior Member
    Join Date
    Oct 2005
    Posts
    157

    Question

    sorry to bother, but did anyone take a look by any chance?

  8. #8
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    The Input Text wasn't working because the Font Family was set to Chinese Characters, in the Properties Panel. Simply change that to something else, like Arial or something. If the dropdown menu only shows Chinese Fonts, manually change it by renaming the Font Family you want!
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  9. #9
    Senior Member
    Join Date
    Oct 2005
    Posts
    157

    Smile

    THANK YOU SO MUCH! haha I didn't know it would be as simple as that! how did you know it was chinese?? it just said the font was called Kozuka

  10. #10
    Senior Member
    Join Date
    Oct 2005
    Posts
    157
    Oh and one more question, can I make it so that when I click on the existing text, it gets erased so you can just start typing in the box without manually having to erase it?

  11. #11
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    You need to listen for FocusEvent.FOCUS_IN and when that is triggered you just set the text to an empty string.

    Actionscript Code:
    myInputField.addEventListener(FocusEvent.FOCUS_IN, onFocus);

    private function onFocus(event : FocusEvent) : void {
            // be careful not to erase text that's not the default
        if(myInputField.text == "Click here to type"){
            myInputField.text = "";
        }
    }

  12. #12
    Senior Member
    Join Date
    Oct 2005
    Posts
    157
    this is my code, but it doesn't seem to be working :/ makes sense though:

    Code:
    var var_load:URLLoader = new URLLoader;
    var URL_request:URLRequest = new URLRequest( "send_email.php" );
    URL_request.method = URLRequestMethod.POST;
    
    send_button.addEventListener(MouseEvent.CLICK, submit);
    
    function submit(e:MouseEvent):void {
    	if(contact_message.text == ""||contact_email.text == "")
    	{
    		stop();
    	}
    	else
    	{
    		var email_data:String = "&email=" + contact_email.text
    					   + "&message=" + contact_message.text;
    					   
    		var URL_vars:URLVariables = new URLVariables(email_data);
    		URL_vars.dataFormat = URLLoaderDataFormat.TEXT;
    		
    		URL_request.data = URL_vars;
    		var_load.load( URL_request );
    		gotoAndPlay("thanks");
    	}
    	
    	
    	
    contact_message.addEventListener(FocusEvent.FOCUS_IN, onFocus);
    
    function onFocus(e:FocusEvent) : void {
            // be careful not to erase text that's not the default
        if(contact_message.text == "Learn more by contacting us, include any details"){
            contact_message.text = "";
        }
    }
    
    contact_email.addEventListener(FocusEvent.FOCUS_IN, onFocus2);
    
    function onFocus2(e:FocusEvent) : void {
            // be careful not to erase text that's not the default
        if(contact_email.text == "your@email.com"){
            contact_email.text = "";
        }
    }
    
    }

  13. #13
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    You'll have to tell me what's supposed to happen and what is happening in order for me to troubleshoot that. Looks correct.

  14. #14
    Senior Member
    Join Date
    Oct 2005
    Posts
    157
    It doesn't seem to change anything, maybe I have the code in the wrong place?
    I wanted it so that when clicked on the default text, it gets erased. But it doesn't do that for some reason.

    Thanks,
    SK

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