dcsimg
A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22

Thread: Backspace key and named anchors

  1. #21
    Member
    Join Date
    May 2002
    Posts
    97
    This happens to me on one forum I deal with. What I have found is that if I back-space to delete, I will <i>sometimes</i> be sent back a page. I think this is an IE thing, not a Flash thing. It is possibly a combination of the two.

    I MUST be wrong! We all KNOW that M$ code doesn't have bugs or security problems!

    Don

  2. #22
    Junior Member
    Join Date
    Aug 2005
    Posts
    27
    When you view a Web page in Internet Explorer and then press the BACKSPACE key, you move back one page in your Internet history.
    I had the same problem using anchors in Flash and pressing the BACKSPACE key while entering text in an input field.
    Notice that if you use the TAB key to tab the focus into your flash movie, the problem goes away.
    It seems that when the anchor changes (the #hash changes in the location bar), IE takes the focus away from the Flash player (even though you can still click and type in your movie)
    To fix the problem, I added this short javascript to the html page to set the focus to the flash plug-in whenever the #hash changes:
    Code:
    &lt;body onLoad="setInterval(function(){if(document.currentanchor!=window.location.hash){document.currentanchor=window.location.hash;if(document.getElementById){obj=document.getElementById('myflashid');if(obj &amp;&amp; obj.focus)obj.focus()}}},1000)"&gt;
    Once the html document is loaded, this script checks the location hash every second. Whenever the hash changes, it finds the Flash plug-in (&lt;object id="myflashid" ...), and sets the focus to that object (using obj.focus()). The BACKSPACE key will then work correctly in input fields.

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