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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jan 2005
    Location
    Colorado
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Java Applet in PHP?

    Hi everyone,
    I have been reading this great forum for a while now.
    There are some smart folks here that I hope can help me out!

    I'm trying to ad a java applet rotating banner to my forum header next to our existing banner. It seems that the applet is working, but it can't seem to find the images for it. I have tried every path to get to the images....but nothing.
    Can anyone tell me what im doing grong? I would greatly appeciate any imput on this problem im having!! Thanks guys!

    The website is www.coloradoprospector.com/forums

    Thanks,
    Denise
    Last edited by Mrs.CP; 01-25-2005 at 12:59 AM.

  • #2
    cfc
    cfc is offline
    Regular Coder
    Join Date
    Dec 2004
    Location
    Keswick, Ontario
    Posts
    251
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's not an applet, it's a JavaScript image rotation script. At first glance (without even touching your JS code), the problem seems to be that you're rotating the images before they can load.

    I can't remember too well from the days I was primarily coding JavaScript, but I think the solution is to load the images before starting the rotation.

  • #3
    New to the CF scene
    Join Date
    Jan 2005
    Location
    Colorado
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks cfc. Your right, I meant to say script....lol
    Thats what no sleep does to you. The script does have the command to tell it to preload the images already.

    This is the code for the script.
    (This is the part I put in the Header)
    <!-- This script and many more are available free online at -->
    <!-- The JavaScript Source!! http://javascript.internet.com -->
    <!-- Original: ShuvoRim (shuvorim@hotmail.com ) -->
    <!-- Web Site: http://www.shuvorim.tk -->
    <script language="JavaScript" type="text/JavaScript"><!--

    /* author@ShuvoRim
    * http://www.shuvorim.tk/
    * shuvorim@hotmail.com
    * (c)ShuvoRim Pvt. Ltd. 2002 -03
    * All rights reserved.
    * --------------------------------------------------
    * visit our web site for more free Java applications
    * and applets. Thank you for using our program.
    * --------------------------------------------------
    */

    var urlArray = new Array(4); //for URL's, increase size as necessary
    var banArray = new Array(4); //for banners, increase size as necessary
    var counter = 1;
    var url = "http://www.coloradoprospector.com"; //initial URL

    //add your necessary URL's
    urlArray[0] = "http://www.coloradoprospector.com/Advertising/advertising.html";
    urlArray[1] = "http://www.minersresponseteam.org";
    urlArray[2] = "http://www.coloradoprospector.com/Vic's_Gold_Panning/vics.html";
    urlArray[3] = "http://www.coloradoprospector.com/Advertising/advertising.html";


    if(document.images) //pre-load all banner images
    {
    for(i = 0; i < 4; i++)
    {
    banArray[i] = new Image(318, 54);
    banArray[i].src = "banner" + (i+1) + ".jpg";
    }
    }


    function changeBanner() //banner changer function
    {
    if(counter > 3)
    counter = 0;

    document.banner.src = banArray[counter].src; //sets a new banner

    url = urlArray[counter]; //sets a new URL to the banner
    counter++; //increase the counter for the next banner
    }

    //calls the changeBanner() function every 3 seconds
    //change the timer as necessary (minutes * 60000) or (seconds * 1000)
    var timer = window.setInterval("changeBanner()", 3000);

    //--></script>




    **************************************************

    (This is the part I put in the body)

    <a href="#" onClick="window.open(url,'BannerWin');">
    <img src="banner1.jpg" width=318 height=54 border=2 name="banner"></a>

    I have all the images for the banner flying open on the site in the public_html folder with the index.html.
    This script seems to work everywhere else on my site besides in the forum.

    Im still lost!? Help?.....

    Sorry for the long post!

  • #4
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,108
    Thanks
    11
    Thanked 101 Times in 99 Posts
    Hi , since this is a javascript question , I am moving it to the javascript forum.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #5
    New to the CF scene
    Join Date
    Jan 2005
    Location
    Colorado
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks firepages! Sorry, I promise to get some sleep...


  •  

    Posting Permissions

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