Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How do I add random number generation

Reply
Thread Tools

How do I add random number generation

 
 
Fan924
Guest
Posts: n/a
 
      09-10-2008
How do I add random number generation to this background image slide
show? Everything I try kills if. TIA
_____________________________________

_

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 2</title>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript1.2">
var pic=new Array()
pic[0]="pic/./000.bmp"
pic[1]="pic/./001.jpg"
pic[2]="pic/./002.jpg"
pic[3]="pic/./003.jpg"
pic[4]="pic/./004.jpg"
pic[5]="pic/./005.jpg"
pic[6]="pic/./006.jpg"
pic[7]="pic/./007.jpg"
pic[8]="pic/./008.jpg"
pic[9]="pic/./009.jpg"
var img=new Array()
for (i=0;i<pic.length;i++){
img[i]=new Image()
img[i].src=pic[i]
}
var enf=-1
function Slide(){
if (enf<pic.length-1)
enf++
else
enf=0
document.body.background=img[enf].src
}
if (document.all||document.getElementById)
window.onload=new Function('setInterval("Slide()",1000)')
</SCRIPT></BODY></HTML>
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      09-12-2008
On Wed, 10 Sep 2008 03:52:59 -0700 (PDT), Fan924 <(E-Mail Removed)>
wrote, quoted or indirectly quoted someone who said :

>How do I add random number generation to this background image slide
>show? Everything I try kills if. TIA
>____________________________________


This group is about Java, not JavaScript. To handle the problem in
Java , see http://mindprod.com/jgloss/pseudorandom.html

--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Math.random() and Math.round(Math.random()) and Math.floor(Math.random()*2) VK Javascript 15 05-02-2010 03:43 PM
Random Number Generation dpi VHDL 4 03-26-2010 10:31 AM
random.random(), random not defined!? globalrev Python 4 04-20-2008 08:12 AM
Need Help With Random Number Generation Between Upper and Lower Bound ANM Java 2 03-07-2004 07:18 AM



Advertisments