A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: button using keystroke

  1. #1
    Member
    Join Date
    Mar 2005
    Posts
    83

    button using keystroke

    I want to make a keystroke (using "i") stop sounds and another keystoke (using "y") to activate the sound again. It will work in the movie, but not in the html. Does anyone know why it won't work when embedded in the html page?

  2. #2
    Senior Member TheLostGuru's Avatar
    Join Date
    Aug 2004
    Location
    I live on this webpage...
    Posts
    784
    maybe the movie needs to have the focus before it works. Try clicking on the swf before pressing i or y.
    "If I have seen further it is by standing on the shoulders of giants." Isaac Newton
    ------------------------------------------------------------------------------

  3. #3
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    the browser takes precedence until the movie is clicked,
    unless you add a function in your html :

    < script>
    function focusIt(){
    if(document.layers){
    document.bob.focus()
    }
    else if(document.getElementById){
    document.getElementById("bob").focus()
    }
    else if(document.all){
    document.all["bob"].focus()
    }
    }
    < /script>
    < /head>
    < body onload="focusIt()">

    < object classid ... ID="bob" >
    < param name=movie value="bob.swf">
    < embed name="bob" ... src="bob.swf"....>

    ( remove the spaces - < script> etc.. )

  4. #4
    Member
    Join Date
    Mar 2005
    Posts
    83
    That worked like a charm, thank you tremendously.

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