Passing certain URL variables to a SWF within a ColdFusion.
Using SWFObject to place my Flash objects.
customvars=user_id,123456;eyecolor,blue;car,accord
Then, in my CF page I put the following code which converts the customvars string into a CF structure:
<cfparam name="url.customvars" default="">
<cfif len(url.customvars)>
<cfloop list="#url.customvars#" delimiters=";" index="customFlashVar">
<cfset thisRecordName = listFirst(customFlashVar,",")>
<cfset thisRecordValue = listLast(customFlashVar,",")>
<cfset flashVars[thisRecordName] = thisRecordValue>
</cfloop>
</cfif>
Then, in my swfObject code, I loop through the structure assigning the name and variable to swfObject's addVariables like this:
fo.addVariable("#key#","#attributes.parms[key]#");
</cfloop>
