aren't you overwriting the value of imagedisplay.imagename?

i think you want an array of structs.

<cfset imageArray = arrayNew(1) />
<cfset imageArray[1] = structNew() />
<cfset imageArray[1].imageID = 1 />
<cfset imageArray[1].imagename = "buy_sidepanelimage.gif" />

<cfset imageArray[2] = structNew() />
<cfset imageArray[2].imageID = 2 />
<cfset imageArray[2].imagename = "buy_sidepanelimage2.gif" />

then...

<cfset myRandNum = randRange(1, arrayLen(imageArray)) />
<cfoutput><img src="images/#imageArray[randNum].imageName#" /></cfoutput>

On Wed, 09 Mar 2005 14:12:57 -0400, Will The Game <[EMAIL PROTECTED]> wrote:
> I'm creating a structure of two images. Then I want them to rotate when the 
> page reloads. I've been doing this fine with my db and using randrange in the 
> WHERE, but how would I make it work with my structure?
> 
> Thanks,
> Will
> 
> <cfset imagedisplay= StructNew()>
> <cfset imagedisplay.imageID = 1>
> <cfset imagedisplay.imagename = "buy_sidepanelimage.gif">
> <cfset imagedisplay.imageID = 2>
> <cfset imagedisplay.imagename = "buy_sidepanelimage2.gif">
> 
> <cfoutput><img src="images/#?????#" width="200" height="350"></cfoutput>
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:198010
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to