Disable hash changing with flash anchor navigation

2019-03-04 16:45发布

问题:

If you specify anchors in frames of the flash movie, IE browser will change hash in address bar while playing it.

http://example.com/ --> http://example.com/#start

Is there any method to disable this navigation using only HTML & JS?

回答1:

There will only be changes if you use the "Flash with named anchors" HTML template for export. It uses an ExternalInterface call to change the address. Remove these lines from the HTML page:

<script language="JavaScript">
    function flashGetHref() { return location.href; }
    function flashPutHref(href) { location.href = href; }
    function flashGetTitle() { return document.title; }
    function flashPutTitle(title) { document.title = title; }
</script>

plus the named anchors inserted into the HTML code (<a name="...">), and there will no longer be any deep linking - unless the app uses SWFAddress, which you could simply remove from the JavaScript imports.