4 Replies Latest reply on May 11, 2006 3:43 AM by blemmo

    Text field

    jaikumari
      Selection.setFocus("txt1")
      txt1 is the instance name of the text box used. When i enter the particular page i want the cursor blink in the first text box( txt1) but the above scripting is not working out. Please help to sort out this.
        • 1. Re: Text field
          nardove Level 1
          hi there

          this is very frustrating because if you open the swf file i'll work fine but if you open it in the browser works when you refresh and if you publish the file dont works, but thats what i know so far hope some one else solve this if this have a solution

          not very helpfull just wanna comment

          sorry for my english

          rS
          • 2. Re: Text field
            blemmo Level 1
            Hi,

            this line works, but only if the Flash movie has focus. It won't work when the focus is elsewhere, e.g. when a html page with the movie is loaded, the focus is somewhere else, outside Flash, so it's not blinking. Click inside the Flash movie and it blinks.
            Because there is no autofocus-Flash-method (none that I know of), you might have to force the user to click somewhere inside the Flash movie, e.g. with a "continue" or "start" button. Once the movie got the focus, the cursor will blink in the textfield.

            hth,
            blemmo
            • 3. Re: Text field
              jaikumari Level 1
              hai,
              thanks.. The problem is im not able to get the focus automatically in the swf. its not working in SWF file also. do you have any solution for that?
              • 4. Re: Text field
                blemmo Level 1
                The only solution I have is to insert a button that has to be pressed, so that the focus is in the movie.
                You can try a simple test: open a new Flash movie, and insert in frame 1 a stop() command and a button that goes to frame 2 onRelease. In frame 2, place the textfield and the Selection.setFocus line. When you test it, the cursor should blink after the button was pressed.
                So there has to be some interaction with the movie before the setFocus will work. I don't know of another way.

                greets,
                blemmo