Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving Pictures : To set everytime starts from different pictures 1

Status
Not open for further replies.

doldol

MIS
Nov 25, 2001
214
SG
Hi.
One fellow leaded me to Java Forum.
I think one of you could help me!
----------------------------------------------------------

I set a moving picture java applet and one problem is,
everytime it starts from the same picture.

For example, if you see this script,

<param name=&quot;images&quot; value=&quot;dog1.jpg|6,dog3.jpg|7,rabbit1.jpg|4,monkey5.jpg|10,dog5.jpg|10,
monkey1.jpg|6,monkey2.jpg|8,dog7.jpg|9,monkey3.jpg|5,monkey4.jpg|10&quot;>


The slide show starts from dog1.jpg and ends up with monkey4.jpg.

I want those pictures start and end randomly.

please help!


<APPLET CODE=ImageChanger.class WIDTH=288 HEIGHT=206 codebase=&quot;./&quot;>
<param name=&quot;images&quot; value=&quot;dog1.jpg|6,dog3.jpg|7,rabbit1.jpg|4,monkey5.jpg|10,dog5.jpg|10,
monkey1.jpg|6,monkey2.jpg|8,dog7.jpg|9,monkey3.jpg|5,monkey4.jpg|10&quot;>
<param name=&quot;fontShadowColor&quot; value=&quot;0&quot;>
<param name=&quot;fontBackColor&quot; value=&quot;202060&quot;>
<param name=&quot;target&quot; value=&quot;text1&quot;>
<param name=&quot;frame&quot; value=&quot;bottom&quot;>
<param name=&quot;autoLink&quot; value=&quot;true&quot;>
</APPLET>
 
Can you please post the contents of ImageChanger.java?

&quot;When you have eliminated the impossible, whatever remains, however
improbable, must be the truth.&quot; ~ Arthur Conan Doyle
 
TNX IDARKE.

'Cause it is so big & long script, can i send you by email?
myworld21@pigpig.net.

 
Yes, go ahead. I'll post the relevant portions for everyone. My email is on my profile.
 
Looking at the source, I see there's a parameter you can use to cause the images to come up randomly. Try in your APPLET tag:

<param name=&quot;randomOrder&quot; value=&quot;true&quot;>

If all you want is to have the starting image random and the other images come up after it in order, in the beginning of the run() method just comment out the check for randomOrder:

Code:
   public void run() {
//	if (randomOrder) {
	    current = (int)(rand.nextFloat()*images.length);
//	}

Sorry it took so long.

 
HooooooooWhaaaoooo...
A MAGIC!
It perfectly Works!

only add the copy of this, <param name=&quot;randomOrder&quot; value=&quot;true&quot;> and it solved! A perfect Solution!

Thank you so much.

PS)I tried to send you an email, but my free email provider seemed had trouble at the moment. I tried to send a few times. after that, waited until now.
BTW, A Big Thanks!

<- this is the one i inserted the tag.Title : Against animal test
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top