PDA

View Full Version : Slot Machine Problem



IanMarlowe
07-05-2005, 12:35 PM
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?

Twey
07-05-2005, 01:30 PM
Please include the URL to the script.

IanMarlowe
07-06-2005, 04:06 AM
http://www.dynamicdrive.com/dynamicindex2/iframe-ticker.htm

jscheuer1
07-06-2005, 03:05 PM
On the external page(s) change this:

setTimeout("rotate_content()",delay)to this:

rotateT=setTimeout("rotate_content()",delay)Add this variable:

var rotateTafter this:

var ie4=document.allAdd this function:

function stopThis(){
clearTimeout(rotateT);
}right before this:

window.onload=rotate_contentNow on the containing page, put this in the head:

<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:

<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:

<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">