Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    embedded swf & browser history

    Does anyone know the affect that playing a swf file has on browser history?

    I need to play swf file - but it's messing up my navigation. I'm building a web-based training course and navigation is limited to previous/next. The Previous link works with javascript's window.history(-1).

    All I want to do is play a swf file without screwing up the previous button. However, I do not want to use a second window - it all needs to remain within the window already open. Below I describe 3 scenarios that I already tried and which do not work properly:

    The first thing I tried was giving the swf it's own page. It went like this:
    On page 10 the user clicks a button which sends them to page X where a swf file played. The last slide of the swf executed a javascript command to send the user back to page 10. Back on page 10, if the user clicks the previous button it takes them to page 9. However, if the user clicks the previous button now on page 9, it takes them back to page 10. And this keeps repeating - making it impossible to return to page 8.

    Next I tried what I do in other situations where users need to go to a page X (but without swf files) is to use javascript's window.location.replace('filename.htm'). And this prevents the previous button from going wacky.

    The scenario goes like this:
    On page 10, a user clicks a button that uses location.replace to send them to page X. On page X, location.replace is used in the embed tag to open the swf file. On the last slide of the swf, location.replace is used to send user back to page 10. So then on page 10, the previous button returns to page 9 and then page 9's previous returns to page 10 and there is another loop between 9 and 10.

    The last thing I tried (and which I'm currently using) is getting rid of page X altogether and using a hidden div tag on page 10 for the embedded swf code. When the user clicks the button on page 10, the div tag turns visible and the swf is set to play. The last slide of the swf file uses location.replace to return to page 10 (which somehow makes the div tag invisible again). Now page 10's previous button goes to page 10, and then to page 9 BUT with no loop. In other words, the user needs to click previous twice to get back to page 9, but is then able to navigate backwards/forwards as usual.

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ignatius
    The last thing I tried (and which I'm currently using) is getting rid of page X altogether and using a hidden div tag on page 10 for the embedded swf code. When the user clicks the button on page 10, the div tag turns visible and the swf is set to play. The last slide of the swf file uses location.replace to return to page 10 (which somehow makes the div tag invisible again). Now page 10's previous button goes to page 10, and then to page 9 BUT with no loop. In other words, the user needs to click previous twice to get back to page 9, but is then able to navigate backwards/forwards as usual.
    You could try: history.go(-1);
    Rather than: location.replace('page.10');

    This should bring you back to page 10 with page 9 on bat in the previous history...

    .....Willy

  • #3
    New to the CF scene
    Join Date
    Oct 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i tried your suggestion, but it didn't work. the swf file ended and didn't return to page 10. from other testing i've done, i think the swf file doesn't detect any other history, so it can't go back one page because there's nothing there. but the browser window still detects the history and records the swf in it.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •