A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: focussing flash movie in Opera

Hybrid View

  1. #1
    curiouser and curiouser LittleRed's Avatar
    Join Date
    Mar 2004
    Location
    Nottingham
    Posts
    335

    focussing flash movie in Opera

    does anyone have any idea how to set the flash movie in an html page to have focus in Opera?
    document.getElementById["moviename"].focus(); works in IE, but not in Opera.
    thanks for any help - this is holding up the entire project!

  2. #2
    Registered User Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Try this;

    <script language = "JavaScript">
    function setFocus()
    {
    document.getElementById("slideshow1").focus();
    }
    </script>
    </head>

    <BODY bgcolor="#121212" MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" RIGHTMARGIN="0" TOPMARGIN="0" BOTTOMMARGIN="0" scroll= "no" onLoad="document.all.slideshow1.focus();">

  3. #3
    curiouser and curiouser LittleRed's Avatar
    Join Date
    Mar 2004
    Location
    Nottingham
    Posts
    335
    thanks for replying,

    where does the function setFocus get called from though?

  4. #4
    Registered User Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    The first lines of java script are in the head tags, then the onLoad function to focus it is in the Body tag itself. I've never tested this in Opera, but it's worked in everything else. When the page loads, the flash movie is focused right away, rather than having to click inside it to focus it.

    In my example, slideshow1 is the name of the swf on the page. Use whatever name you used for your movie.

  5. #5
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    opera won't allow you to focus flash content with javascript. it has to be clicked on to get focus.

  6. #6
    curiouser and curiouser LittleRed's Avatar
    Join Date
    Mar 2004
    Location
    Nottingham
    Posts
    335
    that's what I was worried about - ok thanks

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