One of the big advantages of Flash MX was Named Anchors, which were supposed to allow site navigation with Back and Forward button, history, bookmarking (all with the browser buttons).
But it doesn't work for me. A made a site with 5 pages, and assigned a named anchor to every page. When i jump from page 1 to page 4 for example, and then I click the browser's back button, the site jumps to page 3 (and not 1, what I expect).
I searched this forum for solution and found out, that this function is corrupted. Does anybody know how to fix it? Maybe some additional ActionScript programming? Or some JavaScript function in HTML document would help?
I know theres an alternative solution presented by Robert Penner, but it's not satisfactory, because the HTML page must use frames, additional HTML pages have to be loaded, and there are some audible clicks with some delay, which disturb somewhat a fine Flash project.
I tried to implement a method similar to Robert's, but using named paragraphs in HTML document. But I couldn't find any method to detect, when the Back button was pressed in the browser. Please, help or suggest any ideas. Inside or outide Flash.
To take advantage of named anchor keyframes in your final Flash movie, select the Flash w/ Named Anchors option in the Template pop-up menu on the HTML tab of the Publish Settings dialog box.
It works, but wrong. The browser's buttons Back and Forward navigate linear, always to the previous or next namedAnchor's keyframe on the timeline, even when the user jumped to/from any other keyframe.
Like in the example:
I have 5 pages (5 keyframes with Named Anchors). Let's say they are numbered from 1 to 5.
When I go from page 2 to page 3, and then press Back, the site goes back to page number 2. That's ok.
But when i go form page 2 to page 5, and then press Back, the site goes to page 4, which haven't even been displayed yet, so should'n be in history at all...
That's my problem. The Back button doesnt return to previous displayed named anchor, but always to the previous one existing on timeline.
also you don't need different pages for the page in the iframe. Just pass all the variables you need along with the url string and use a javascript on that page to parse the url query string.
(ie. "nav.html?title=pagetitle&flashframe=thisframe ")
make sure you use *.js for the script so you only have to download it once.
I just went to find some details about iframes and i started to wander what a beautiful thing IFRAMES are, and what possibilities they give, but then on http://developer.apple.com/internet/...pt/iframe.html I found this:
Sadly, referencing the IFRAME's document object is no simple task, since IE5, IE5.5, IE6, and NS6 all provide different ways to access it. IE5, both on the Mac and PC, provides the simplest method: IFRAMEs in this browser show up in the document.frames array and have a document property. In IE5.5, IE6 and NS6, you can retrieve the IFRAME element object with document.getElementByID(), then, in NS6, use the object's contentDocument property, and in IE 5.5+, use the document property of the IFRAME object's contentWindow property [...]
Man, aren't they stupid? Why they create such a mess?
Last edited by Marek Binkowski; 07-18-2003 at 07:51 AM.
They said the iframe logs the pages in the iframes into the browser history, but that is exactly what you want here. As for IE5, IE5.5, IE6, and NS6, I don't know how they work. I think iframes works well in ie, but not in NS. Sometimes in older(or maybe even newer) versions of NS, the back button only acts on the "parent page", not the frames pages (same problem for regular frames or iframes).
Yes, the thing with history would be great, because it's exactly what I was looking for and I'd love it. But for every version of IE (just one browser, one producer!) I'm supposed to detect it and make a different script, and I hate it.
I thing that's why iframes are used so rare and are so unknown, despite of their potential usefullness.
That's what i love in Flash, that I have just one ActionScript and it just works :-)
I think misunderstood the article. It went through all that trouble to PREVENT browser from logging history. To make it log history, you don't have to do that stuff. It'll work just like a regular frame.
Here is one I made, but it doesn't work offline with IE. IE doesn't let you have query strings in the url of local files. It'll work online. Tested on IE 6 and NS7.1