Results 1 to 4 of 4

Thread: Slot Machine Problem

  1. #1
    Join Date
    Jul 2005
    Location
    Kuwait-I'm American
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb Slot Machine Problem

    I am trying to make a slots machine online, using the:

    /***********************************************
    * IFRAME Scroller script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    . It isn't too hard, just line up three of these in a row, and then change the pictures to fruits, and stuff, and make it so seemingly "random" pictures appear. What I am stuck on is how I can put in like a button, that will stop all three Scrollers from moving, in case the user sees all three of the pictures match up. Have any ideas, or is this something that should be done with flash?
    //\\ //\\// || //\\//\\ //\\ ||_
    SOFTWARE

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Please include the URL to the script.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jul 2005
    Location
    Kuwait-I'm American
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    On the external page(s) change this:
    Code:
    setTimeout("rotate_content()",delay)
    to this:
    Code:
    rotateT=setTimeout("rotate_content()",delay)
    Add this variable:
    Code:
    var rotateT
    after this:
    Code:
    var ie4=document.all
    Add this function:
    Code:
    function stopThis(){
    clearTimeout(rotateT);
    }
    right before this:
    Code:
    window.onload=rotate_content
    Now on the containing page, put this in the head:
    Code:
    <script type="text/javascript">
    function stopTic(){
    window.tic1.stopThis();
    window.tic2.stopThis();
    window.tic3.stopThis();
    }
    
    function startTic(){
    window.tic1.rotate_content();
    window.tic2.rotate_content();
    window.tic3.rotate_content();
    }
    </script>
    and name each iframe tic1, tic2 and tic3 - ex:
    HTML Code:
    <iframe name="tic1" id="tickermain1" src="external.htm" width=150 height=120 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=1 scrolling=no></iframe>
    Use these two buttons to start and stop:
    HTML Code:
    <input id="stop" type="button" value="Stop" onclick="stopTic();document.getElementById('start').disabled=0">
    <input id="start" type="button" disabled value="Start" onclick="startTic();this.disabled=1">
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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