A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Text Boxes! how do they make the cursor flash and erase whats currently in the box???

  1. #1
    Senior Member
    Join Date
    Jan 2004
    Location
    Canada
    Posts
    309

    Text Boxes! how do they make the cursor flash and erase whats currently in the box???

    Please help me out if you can. I have wondered this for so long now. How do they make it so when you click on a text box w.e is in it disapears so you can type your own stuff. as well as the cursor flashes?? can someone help me out please. Thanks.





    Matt

  2. #2
    Who, What, Why ... ? Fraggs's Avatar
    Join Date
    Jul 2003
    Location
    Flashland .. where else ?
    Posts
    786
    The cursor flashing is an automatic thing, you don't control that (or am I mistaken?)

    As for your other question, once you have created your input text field, if you type some message inside it then export the movie, the message will show up. When the user click in the field the message will dissapear so they can type they're own stuff.

    Regards,

  3. #3
    Senior Member
    Join Date
    Jan 2004
    Location
    Canada
    Posts
    309
    Ok wait I dont really understand that?

  4. #4
    Senior Member sharma's Avatar
    Join Date
    Oct 2004
    Location
    Canadia
    Posts
    1,017
    i dont think what he suggested will work but he is bassically saying create an input text box.. type the content you want inside of it

    export it..

    now test it out..
    the message should be within the text box.. but when you click it wont disappear.. you'd have to highlight it and type over it...

    hmm im to lazy to figure this one out tonight.. sorry

  5. #5
    Who, What, Why ... ? Fraggs's Avatar
    Join Date
    Jul 2003
    Location
    Flashland .. where else ?
    Posts
    786
    You need to make the text box an input text field. This is done by changing the properties of the field in the properties panel. Once you have created your text field, type something in the area and export your movie.

    You will see your text in the field area, give the field focus and your text will disapear and your cursor will be sat in the field flashing for you.

    Regards,

  6. #6
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    Fraggs, that is not true.

    If you create an input text field with some text in, it will not automatically be deleted when you click inside it!

    You will need some code to handle that for you.

    If your input text field is called "inputTxt", this code will set an initial text for the box and clear it when the user clicks inside it (unless the text has been changed by the user).

    code:

    defaultTxt = "<insert something here>";
    inputTxt.text = defaultTxt;
    inputTxt.onSetFocus = function(){
    if (this.text == defaultTxt){
    this.text = "";
    }
    }

    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  7. #7
    Who, What, Why ... ? Fraggs's Avatar
    Join Date
    Jul 2003
    Location
    Flashland .. where else ?
    Posts
    786
    It worked for me.

    Perhaps my version is broken or something.

  8. #8
    Flashkit Veteran joejoe2288's Avatar
    Join Date
    Apr 2004
    Location
    Hickville, Oregon
    Posts
    2,554
    Yea lex is right, but my flash had done something like this before too, but after I saved the file and then tried it it worked fine (it was pissing me off)
    So tired of all the fighting....

    http://joejoe2288.kawanda.net

  9. #9
    Flashkit Veteran joejoe2288's Avatar
    Join Date
    Apr 2004
    Location
    Hickville, Oregon
    Posts
    2,554
    Hey lexicon, I was just checking your site, did you make that top banner it is a really good display of animation
    So tired of all the fighting....

    http://joejoe2288.kawanda.net

  10. #10
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    my site doesn't have a top banner
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  11. #11
    Flashkit Veteran joejoe2288's Avatar
    Join Date
    Apr 2004
    Location
    Hickville, Oregon
    Posts
    2,554
    yea it does, the html site
    So tired of all the fighting....

    http://joejoe2288.kawanda.net

  12. #12
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    umm yes i made it in photoshop. it definitly does not animate tho It helps to have a girlfriend who is fantastic at photography, gives a good base to create graphics from She is superb at photo's of textures. I just mix em up in photoshop using different layer effects.
    Last edited by Lexicon; 10-10-2004 at 03:38 PM.
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  13. #13
    Flashkit Veteran joejoe2288's Avatar
    Join Date
    Apr 2004
    Location
    Hickville, Oregon
    Posts
    2,554
    Originally posted by joejoe2288
    Hey lexicon, I was just checking your site, did you make that top banner it is a really good display of animation
    Animation as in graphics but it is really cool
    So tired of all the fighting....

    http://joejoe2288.kawanda.net

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