Hi. Using the ExternalInterface methodology of calling focus may give flash focus, but not keyboard focus. I mean, I have a flash movie with a text input that receives browser focus, but I can´t write/type anything. If I press any key, won´t write/type anything on input text.
On Monday, November 7, 2011 4:02:58 PM UTC-2, Misterhee wrote: > > @Alex - Using the ExternalInterface methodology of calling focus from > within the swf after it is rendered etc (as described in my first response) > worked in all recent versions of FF/Safari/IE/Chrome/Opera that I tested. > > Setting the tab index seemed to fix the focus issue on some versions. > > In my situation, I needed not only to focus the swf on page load (kiosk > app driven by keyboard / remote control), but needed to be able to defocus > the Flash so the swap browser tab shortcut worked on FF as well... It was > pretty annoying to get working, but boiled down to some pretty simple > functions in the end... > > > Cheers, > Aran > > > > > On Mon, Nov 7, 2011 at 11:54 AM, Alex Harui <aha...@adobe.com> wrote: > >> Which browser and version of the browser? I am under the impression that >> the focus() call doesn't work on all browsers. >> >> >> On 11/7/11 9:33 AM, "tidybox" <tidy...@hotmail.co.uk> wrote: >> >> > Thanks for the quick response and I have tried both your suggestions >> > but still not working! >> > I'm not the best at coding and my original code doesn't seem to >> > reflect your suggestions so maybe I'm altering it incorrectly (I used >> > the air swfObject2 generator)! >> > Here is my HTML code before adding any of your stuff and maybe you can >> > point me in the right direction as to where to place the new code. >> > >> > Much appreciated >> > >> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http:// >> > www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> >> > <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> >> > <head> >> > <title>Portfolio</title> >> > <meta http-equiv="Content-Type" content="text/html; >> > charset=ISO-8859-1" /> >> > <script type="text/javascript" src="swfobject.js"></script> >> > <script type="text/javascript"> >> > var flashvars = {}; >> > var params = {}; >> > params.menu = "false"; >> > params.quality = "best"; >> > params.salign = "tl"; >> > params.bgcolor = "#F7ECDA"; >> > var attributes = {}; >> > attributes.id = "swfContent"; >> > swfobject.embedSWF("VendMach.swf", "flashDiv", "1152", "864", >> > "9.0.0", "expressInstall.swf", flashvars, params, attributes); >> > </script> >> > <style type="text/css" media="screen"> >> > object { outline:none; } >> > <!-- >> > body { >> > background-color: #F7ECDA; >> > margin-left: 0px; >> > margin-top: 0px; >> > margin-right: 0px; >> > margin-bottom: 0px; >> > } >> > --> >> > </style> >> > <meta name="Keywords" content="Graphic Designer, Graphic Design, >> > Photoshop, illustrator, animation, print work, design, inDesign, >> > freelance" /> >> > <meta name="Description" content="MyPortfolio, freelance graphic >> > designer" /> >> > </head> >> > <body> >> > <div id="flashDiv"> >> > <a href="http://www.adobe.com/go/getflashplayer"> >> > <img src="http://www.adobe.com/images/shared/download_buttons/ >> > get_flash_player.gif" alt="Get Adobe Flash player" /> >> > </a> >> > </div> >> > </body> >> > </html> >> > >> > ____________________________________________________________________ >> > >> > On Nov 7, 4:20 pm, Aran Rhee <aran.r...@gmail.com> wrote: >> >> Have a read of my reply to this question in this thread: >> >> >> >> http://groups.google.com/group/swfobject/msg/b0dc02d06db7aa43?hl=en_US >> >> >> >> That in my opinion is the correct way to do it (as you can ensure the >> focus >> >> (and defocus) calls work as intended) >> >> >> >> A simpler way which works in *most* browsers is to call a function on >> page >> >> load. Set the name and id in your attributes object for your embedSWF() >> >> call, and then call the focus method once all the page content had >> loaded. >> >> >> >> <head> >> >> <script type="text/javascript"> >> >> function setFocus() >> >> { >> >> document.getElementById('myflashid').focus();} >> >> >> >> </script> >> >> ... >> >> </head> >> >> >> >> <body onLoad="setFocus();"> >> >> >> >> Aran >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> On Mon, Nov 7, 2011 at 10:09 AM, tidybox <tidy...@hotmail.co.uk> >> wrote: >> >>> I have an HTML page with only a single flash object on it which is >> >>> embedded using the 2.1 swfObject "Dynamic" generator and I want to be >> >>> able to use the keyboard straight away without the user first having >> >>> to click on the flash movie first! Can anyone advise me what code I >> >>> should use and where should it be placed in the generated HTML?? >> >> >> >>> Thanks >> >> >> >>> -- >> >>> You received this message because you are subscribed to the Google >> Groups >> >>> "SWFObject" group. >> >>> To post to this group, send email to swfobject@googlegroups.com. >> >>> To unsubscribe from this group, send email to >> >>> swfobject+unsubscr...@googlegroups.com. >> >>> For more options, visit this group at >> >>> http://groups.google.com/group/swfobject?hl=en. >> >> -- >> Alex Harui >> Flex SDK Team >> Adobe System, Inc. >> http://blogs.adobe.com/aharui >> >> -- >> You received this message because you are subscribed to the Google Groups >> "SWFObject" group. >> To post to this group, send email to swfobject@googlegroups.com. >> To unsubscribe from this group, send email to >> swfobject+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/swfobject?hl=en. >> >> > -- You received this message because you are subscribed to the Google Groups "SWFObject" group. To view this discussion on the web visit https://groups.google.com/d/msg/swfobject/-/qy14szSH-d8J. To post to this group, send email to swfobject@googlegroups.com. To unsubscribe from this group, send email to swfobject+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/swfobject?hl=en.