flash + javascript enabled browser back but error on lauching lightbox

Discussion in 'JavaScript' started by chinmasterj, Nov 6, 2008.

  1. #1
    Hello Everbody,

    I have been at this problem for 10 hours now and am going NUTS!! I am making website to look around an ancient Egyptian Tomb. Feel free to have a look: http://www.campbelltest.co.uk/britishMuseum/online/

    I have a flash movie which I have scripted to utilise the browser back button using this script http://www.asual.com/swfaddress/docs/ This works fine until open a lightbox image form within the flash movie using Lokesh Dhakar Light box http://www.lokeshdhakar.com/projects/lightbox2/and the browsers back button stops working!!

    The code below is to the JavScript links and the code that lauches the lightbox:

    <script type="text/javascript" src="js/swfaddress-optimizer.js"></script>
    
            <script type="text/javascript" src="js/swfobject.js"></script>
    
            <script type="text/javascript" src="js/swfaddress.js"></script>
    
            <script type="text/javascript" src="js/swfmacmousewheel.js"></script>
    
            <script src="js/prototype.js" type="text/javascript"></script>
    
      <script src="js/scriptaculous.js?load=effects" type="text/javascript"></script>
    
            <script src="js/lightbox.js" type="text/javascript"></script>
    
            <!-- start | JC -->
    
            <!-- added for flash -->
    
            <!-- added for launch from flash -->
    
            <script language="JavaScript">
    
                function openLightbox(url,group){
    
        var objLink = document.createElement('a');
    
        objLink.setAttribute('href',url);
    
        objLink.setAttribute('rel','lightbox['+group+']');
    
        objLink.setAttribute('title','caption');
    
        Lightbox.prototype.start(objLink);
    
                }
    
            </script>
    
            <!-- end | JC -->
    Code (markup):
    This code is how I have embeded the flash in the page:

    <script type="text/javascript">
    
          var so = new SWFObject('container04.swf', 'container04', '760', '450', '8', '#ffffff');
    
                so.useExpressInstall('js/expressinstall.swf');
    
          so.addParam('menu', 'false');  
    
       //so.addParam('movie','container04');       
    
          so.write('flashcontent');
    
          var macmousewheel = new SWFMacMouseWheel( so );
    
         </script>
    Code (markup):
    I have added a text box to movie that shows the back button function exicuting and what its exicuting. I have never done any work with JavaScript before so I am up the creek without a paddle!!
     
    chinmasterj, Nov 6, 2008 IP