Flash+PHP image gallery/catalogue

I need Flash to display a page of images and text (see attached sketch) dynamically loaded from the MySQL database, via PHP.

In my MySQL database, I’ve got:
[COLOR=“DarkRed”][FONT=“Courier New”]id (auto increment)
name
artists
date
image[/FONT][/COLOR]

I can get the PHP file to output something like:
[COLOR=“DarkRed”][FONT=“Courier New”]name2=Someone&artists2=Someone&date2=2006&name1=Someone&artists1=Someone&date1=2005[/FONT][/COLOR]

Problem is, I need an efficient and uncomplicated way to have Flash read these variables and put them into each textbox. I mean, I could fumble around with heaps of messy code to achieve the desired effect, but I’m sure there’s a nice, simple way of doing this.

Also, the items need to be displayed in descending order, according to the ‘id’.

Not too worried about the dynamically loaded images just yet… I just want to get the basic text loading worked out, and I’ll go from there.

I think all this has something to do with using ‘loops’ or something, but I’ve got no idea.

Thanks in advance!!

yes it has to do with loops.

at the end of all your variables pass a &numberOfResults=11& or whatever - using that function in php that i forget -

then in flash use


for (i=1; i<=numberOfResults; i++) {
	//
	_root["textfield_mc"+i].name_textbox.text = _root["name"+i];
	_root["textfield_mc"+i].artist_textbox.text = _root["artist"+i];
	_root["textfield_mc"+i].year_textbox.text = _root["year"+i];
	//
}

to go thru and put the vars in the texfields…

or


for (i=numberOfResults; i>0; i--) {
	//
	_root["textfield_mc"+i].name_textbox.text = _root["name"+i];
	_root["textfield_mc"+i].artist_textbox.text = _root["artist"+i];
	_root["textfield_mc"+i].year_textbox.text = _root["year"+i];
	//
}

to start at the end and work backwards thru the results

You’re an absolute legend, buddy. Thanks :hugegrin:

im surprised you been here so long and dont know loops?

Older but none the wiser :wink:

It’s just something I’ve never needed to look into, that’s all.