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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript / Flash / Frames.... confusing.... YES!

    Greetings! After countless hours scouring the net and carton of smokes later I have come to my whit's end and request any assistance that might be given in helping solve my problem.

    I have a set of frames, the one named bottom is a 1px place holder for a mp3 player. The one named top is the main site with a different flash banner allowing the user to change songs in the flash mp3 player (yea, it sounds complex and it is)

    The script works great under Internet Explorer 7, does everything it needs to do, HOWEVER firefox calls the javascript function fine, but does not proceed to change the song. This has to be a browser compatibility issues as I have tracked down all other variables.

    Please visit the site here www.tailgateville.com and take a look at the source below.

    Thanks for any ideas you may have in helping me correct this.

    frames page code
    Code:
    <html><head>
    <title>Welcome</title>
    </head>
    <body>
    <frameset border="0" cols="1,*" frameborder="0" framespacing="0">
    
    <frame id="bottom" name="bottom" scrolling="no" src="music.html">
    <frame id="top" name="top" scrolling="auto" src="index2.html">
    <noframes>	<p>This page uses frames</p></noframes>
    </body>
    
    </frameset>
    </html>
    index2.html (Frame id=top) Snipps from code
    header code NOW THIS IS TRIPPY. FIREFOX RUNS THE 1ST ALERT WITHIN THE SCRIPT, BUT NOT THE SECOND AND IT DOES NOT CHANGE THE SONG
    Code:
    <script type="text/javascript" language="javascript">
    var browser=navigator.appName;
    function next()
    	{alert('next'); parent.bottom.window.music.tgotolabel("_level0.control/","nextsong"); alert('over');}
    </script>
    flash banner placement code
    Code:
    <script type="text/javascript">
    if (browser != "Netscape"){
    document.write('<object data="splash_banner.swf" swLiveConnect="true" height="240" style="background-color: transparent" type="application/x-shockwave-flash" width="1024">');
    document.write('<param name="movie" value="splash_banner.swf" />');
    document.write('<param name="quality" value="High" />');
    document.write('<param name="wmode" value="transparent" />');
    document.write('</object>');
    }else{
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="1024" height="240" id="flashObject">');
    document.write('<param name="allowScriptAccess" value="sameDomain" />');
    document.write('<param name="movie" value="splash_banner.swf" />');
    document.write('<param name="quality" value="best" />');
    document.write('<param name="bgcolor" value="#ffffff" />');
    document.write('<param name="menu" value="false" />');
    document.write('<param name="swliveconnect" value="true">'); 
    document.write('<embed src="splash_banner.swf" quality="high" bgcolor="#ffffff" menu="false" width="1024" height="240" name="flashObject" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.write('</object>');
    }
    </script>

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,869
    Thanks
    79
    Thanked 4,421 Times in 4,386 Posts
    After countless hours scouring the net and carton of smokes later
    Ah, well, there's your problem, right there! All that smoke has clouded your vision. <grin style="evil" />

    Anyway...

    Have you debugged????

    And/or tracked the problem?

    The fact that the second alert in that line doesn't show *CLEARLY* indicates that you are getting a JavaScript ERROR in the middle statement. So... Check it in pieces, if all else fails.
    Code:
    function next()
    {
         alert('next function called');
         var p = parent;
         if ( p == null ) 
         {
             alert("parent object is null...kablooey");
             return;
         }
         var b = p.bottom;
         if ( b == null ) 
         {
             alert("parent.bottom object is null...kablooey");
             return;
         }
         var w = b.window;
         if ( w == null ) 
         {
             alert("parent.bottom.window object is null...kablooey");
             return;
         }
         var f = w.tgototlabel;
         if ( f == null ) 
         {
             alert("parent.bottom.window.tgotolabel function is null...kablooey");
             return;
         }
         f("_level0.control");
         alert("tgotolabel function called successfully");
    }


  •  

    Posting Permissions

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