Listing 1
<!--- loop through the categories query --->
<cfloop query="get_cats">
<!--- append the category to the category list --->
<cfset cats=ListAppend(cats,category,"|")>
<!--- now query to get the sub categories and url links --->
<cfquery datasource="flashmenu" name=
"get_subcats" dbtype="odbc">
select subcategory,url
from subcats
where catid=#catid#
</cfquery>
Listing 2
<!--- initialize the subcats list --->
<cfset subcats="">
<!--- initialize the urls list --->
<cfset urls="">
<!--- create another loop for the sub categories --->
<cfloop query="get_subcats">
<cfset subcats=ListAppend(subcats,subcategory,"|")>
<cfset urls=ListAppend(urls,url,"|")>
<!--- end sub categories loop --->
</cfloop>
Listing 3
<!--- output the subcats and the urls --->
<cfoutput>&subcats#count#=#subcats
#&urls#count#=#urls#</cfoutput>
<cfset count=count+1>
<!--- end categories loop --->
</cfloop>
<!--- output the cats --->
<cfoutput>&cats=#cats#&loaded=1&</cfoutput>
Listing 4
// take the cats variable and split it into an array
cats = cats.split("|");
// get the initial cats clip y position
ystart = getProperty("cats_clip", _y);
// create the loop to duplicate the cat clips
for (i=0; i<cats.length; i++) {
duplicateMovieClip ("cats_clip", "cats_clip"+i, i);
setProperty ("cats_clip"+i, _y, ystart+i*20);
// set the category text in the cat clip
set ("cats_clip"+i+".category", cats[i]);
// set the sub category index in the subcat container
set ("cats_clip"+i+".subcat_container.index", i);
// set the sub category variable in the subcat container
set ("cats_clip"+i+".subcat_container.subcat", eval("subcats"+i));
// set the url variable in the subcat container
set ("cats_clip"+i+".subcat_container.url", eval("urls"+i));
}