A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: place cursor in text box?

  1. #1
    Junior Member
    Join Date
    Feb 2001
    Posts
    4
    Does anyone know how I can have the cursor display within a text box, without the user first clicking in the box or tabbing to the box? That is, on page entry, I want the user to be able to simply type his or her user name and click Enter. I've heard that it works in a stand alone swf, but once the swf is embedded in an html page, this function is lost - the user must first click in or tab to the text box. True? If not, how to work around this? Thanks for your help.

  2. #2
    I'm a hero like Robert De Niro
    Join Date
    Mar 2000
    Location
    London
    Posts
    1,171
    Hello,

    You can create a small movie clip that flickers inside the text box and on rollover disappears.I guess its not the sort of solution you were hopping for but it might actually do the trick.

    Hope it helps,

    McMurphy

  3. #3
    Junior Member
    Join Date
    Feb 2001
    Posts
    4
    What if the user does not roll over the flickering clip? What if s/he justs starts to type? Will it work then? The whole point is that I don't want to have to explain to the user that they must first click in the box, tab to the box, or roll over the box before they type. The population that I'm dealing with is likely not to understand - typing their names will be challenging enough. Thanks again.

  4. #4
    I'm a hero like Robert De Niro
    Join Date
    Mar 2000
    Location
    London
    Posts
    1,171
    Well... how about placing an animation and text telling them you type in their name? a small arrow maybe and a flickering sentence..You should think of the user,that's for sure and sometimes it means doing things that may look kinda stupid or useless.

    McMurphy

  5. #5
    Hunt, Michael
    Join Date
    Sep 2000
    Posts
    192
    Have a look in the action script dictionary under "selection.setFocus"
    basically it allows you to set the focus on a text field, not entirely sure of the intricacies but take a look.

    hope it helps


    c

  6. #6
    Junior Member
    Join Date
    Aug 2001
    Posts
    2

    setFocus

    Originally posted by dogz
    Does anyone know how I can have the cursor display within a text box, without the user first clicking in the box or tabbing to the box? That is, on page entry, I want the user to be able to simply type his or her user name and click Enter. I've heard that it works in a stand alone swf, but once the swf is embedded in an html page, this function is lost - the user must first click in or tab to the text box. True? If not, how to work around this? Thanks for your help.
    Hi.I'm currently having the same problem.I used setFocus to focus my cursor onto the my 1st textbox so that the user can type anything.It works on the swf file but once I embedded in an html page, it doesn't work although the cursor is blinking. Do you have the solution??? I don't want to tell the user to either click on the textbox or press the tab key.

  7. #7

    Talking Browser issue

    What browser and Os is it not working in? This will make a big difference.

  8. #8

    Talking Browser issue

    Azlin,
    What browser and Os is it not working in? Check, because this will make a big difference.

  9. #9
    Junior Member
    Join Date
    Aug 2001
    Posts
    2

    Re: Browser issue

    Originally posted by quazip
    Azlin,
    What browser and Os is it not working in? Check, because this will make a big difference.
    I'm using IE in Win 98.I think it git something to do with the html codes.Something about a JavaScript.I'm not so sure about it.Anyone know the complete codes??

  10. #10
    Senior Member
    Join Date
    Sep 2000
    Posts
    910
    Hi...here's what you need...put this in the head of your HTML...

    Code:
    <script language = "javascript">
    	function focusMovie(){
       	document.mymovie.focus()
    }
    </script>
    ...in the body put this...

    Code:
    <BODY bgcolor="#FFFFFF" onLoad="focusMovie()">
    Then you need to give your movie an "ID" in the Object/Embed tags...I used 'mymovie'...it could be anything, but if you change it...change it in the javascript function as well...
    In the code I 'bolded' what you need to add....

    Code:
    <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
     codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
    WIDTH=700 HEIGHT=350 ID="mymovie">
    <PARAM NAME=movie VALUE="your.swf"> 
    <PARAM NAME=quality VALUE=high> 
    <PARAM NAME=bgcolor VALUE=#FFFFFF> 
    <EMBED src="your.swf" quality=high bgcolor=#FFFFFF  WIDTH=700 HEIGHT=350 
    NAME=mymovie swLiveConnect=true 
    TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?
    P1_Prod_Version=ShockwaveFlash"></EMBED>
    </OBJECT>
    Hope this helps...

    -pigghost-

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