Learn: Cursor Focus

Home Food Mates • Members Tutorials Forum Buy Templates Contact Us 

 


Flash Tutorials

   

Flash Tutorial - User Name and Password - Advanced Features

 

Free Tutorial


Step 6    <<   Previous      Intro   1   2   3   4   5   6    >>       >>   Webwasp Mates

 

Step Six: Browser Compatibility and Setting the Cursor's Focus


Note the red asterisk
* and yellow input box.

You will notice from the advanced Movie above that the red asterisk* and yellow input box disappear when you enter the right user name and then the right password. This makes the user name and password look and act like required fields on a web page form. The clever part is that if the user gets the username right but their password wrong, then the password will have the cursor placed in it. However if you also change the user name, then the code recognizes that the user name has changed and if it is incorrect, it sets the cursor back in the user name input box.

To see what I mean type in the user name: web (case sensitive) into the user name input box in the Movie above (leave the password input box empty) and press Enter. Your see the red asterisk* and yellow box disappear from the user name input box. However the password yellow box and red asterisk* remain in the password field. The password input box will now have the cursor blinking inside the password input box.

Cross Ref: For more info on using the Tab Key see the tutorial on the Tab Function

    Note - Setting Focus: Flash Movies don't automatically get focus when a web page loads so you have to click on the Flash Movie to give it focus. Currently there is no method known to set focus on a Flash Movie when the web page first loads, and no method which works in ALL Browsers. For most Browsers you have to select (click on) the Flash Movie before it has focus. We can only hope that one day soon Macromedia or the Browser publishers decide to make life easier for us all by changing this. Also remember that if you use the Flash Movie on it’s own (say your making a web site entirely out of Flash) that the Movie will not automatically have focus and that the user will still have to click on it to set the focus.

    The old method no longer works in Windows XP Service Pack 2. If you wish to use it, it is as follows:

    <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="myothermovie">
    <param name="movie" value="NameOfYourSWFMovie.swf">
    <param name="SeamlessTabbing" value="false">
    <param name="swLiveConnect" value="true">
    <param name="quality" value="high">
    <embed NAME="myothermovie" 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>

    Change the XXX to the values for the width and height that you require for your Movie.

    Change the NameOfYourSWFMovie.swf to the name of the swf Movie file. In the open body tag in your html code change it from <BODY> to <BODY onLoad="window.document.myothermovie.focus();">

    This method still works with Windows XP Service Pack 1. There are other ways to set focus on a Flash Movie with JavaScript that will work in Internet Explorer on a Windows Service Pack 2 PC, but there is no method that will work in all Browsers like Mozilla, Netscape etc.

 

Please indicate what you thought of this tutorial 
10 is the best: 
10 9 8 7 6 5 4 3 2 1

         

Step 6    <<   Previous      Intro   1   2   3   4   5   6    >>       >>   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

 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.