Learn Flash Tutorials: Automatic Focus in a Flash Form

Home Food Mates • Members Tutorials Forum Buy Templates Contact Us 

 


Flash Tutorials

   

Flash Tutorial - Automatic Focus in a Flash Form

 

Free Tutorial


Step 2    <<   Previous      Intro   1   2   3     Next   >>       >>   Webwasp Mates

 

Step Two: Publishing the Movie

  1. Save your file: File > Save (Ctrl S)
  2. Go to: File > Publish Settings (Ctrl Shift F12)
  3. For Type select only: Flash
  4. Click: Publish
  5. Click:OK
  6. Note: This will create a Flash swf (Shock Wave File) in the same location as your main Flash Movie. You will now have two files such as:



    My Flash files.

  7. Take a note of the Width and Height of your Movie. You can find this info in: Modify > Document (Ctrl J)
  8. Save your file: File > Save (Ctrl S)
  9. Close Flash: File > Exit (Ctrl Q)

  10. Open your favourite: Web Editor
  11. Note: You can use any program that will enable you to create web pages and edit the HTML such as Dreamweaver, FrontPage or Note Pad.

  12. Open or create a standard: HTML Web page
  13. Save this file.
  14. Note: This web page and the Flash Movie (swf file) must be saved to the same location or folder. You may need to use My Computer or some similar file management program to move the Flash swf file to the same location as the HTML web page.

  15. Add the Flash Movie to your web page by using this HTML code:

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="XXX" height="XXX" id=mymovie>
    <param name="movie" value="
    NameOfYourSWFMovie.swf">
    <param name="SeamlessTabbing" value="false">
    <param name="swLiveConnect" value="true">
    <param name="quality" value="high">
    <embed NAME=
    mymovie src="NameOfYourSWFMovie.swf" SeamlessTabbing="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="XXX" height="XXX" swLiveConnect=true></embed>
    </object>


  16. Change the XXX to the values for the width and height of your movie.
  17. Change the NameOfYourSWFMovie.swf to the name of your: Flash swf file

    Important: You do not need to change the: id=mymovie
    But if you do wish to change this Do Not use capital letters in the id as this can cause problems with some browsers.

  1. In the opening Body Tag in your HTML code change to:

    <body onLoad="window.document.mymovie.focus();">

That's it !

When you run the movie and click in the first text box and press the Tab key a few times your notice that it moves from box to box. The advantage of this code is that if an input box has something in it, it will set the cursor at the end of the text which is very handy. Try typing something short into one of the input box's when you run the movie and then press the Tab key until that input box has focus again. You will notice how the blinking cursor is set at the end of the length of text that you typed in.


    Important Note: When you view the Flash Movie in Internet Explorer the Movie will automatically have focus when the page loads and set focus will be on the first input box. You will see the blinking cursor automatically displayed and you can start typing without having to click on the Flash Movie first. HOWEVER! There is currently no known method to set focus on a Flash Movie when the web page first loads and that works in ALL Browsers. This is the best method to date but it ONLY works in Microsoft’s Internet Explorer and NOT Netscape or Mozilla etc. For any other Browser you have to select the Flash Movie before it has focus which is a unavoidable for now. We can only hope that one day soon Macromedia or Internet Browser's companies decide to make life easier for us all. They could formulate a method to set focus on a Flash Movie when a web page first loads that works on ALL known browsers. Also remember that if you use the swf on it’s own (say your making a web site entirely out of flash) that the swf will not automatically have focus and that the user will still have to click on it to set the focus.

         

Step 2    <<   Previous      Intro   1   2   3     Next   >>       >>   Webwasp Mates


Webwasp Community: Webwasp Mates & Dates

Why not try out webwasp's new community. Meet new people, find friends in your area: Webwasp Mates & Dates

29740 visitors to this page since Sept 05 •

 Top of Page Home Food Mates Members Tutorials Forum Buy Templates Contact Us 
 All material on this site is protected under international copyright © law. DO NOT reproduce any material from this site without written permission. Please ask as permission is often granted.