On 9/8/06, yaagcur <[EMAIL PROTECTED]> wrote:
>  Looking at the documentation it appears as though either Flex data
>  services(which I was not planning to use) or HttpServletRequest( which
>  i have no experience with) might be required. Is there another way via
>  ColdFusion?
>

In my case, I'm just starting to incorporate Flex apps into a
ColdFusion-based intranet application portal environment.  Although we
don't use much in the way of URL query variables, we do have a great
deal of information (about users, what they're doing, portal features,
etc.) that we keep in ColdFusion session, client, and
application-scoped variables.

It made sense to me to move the default Flex HTML template into a
ColdFusion template and to modify it so that I can dynamically pass in
a variety of information from the portal to the Flex applcation.
Creating dynamic FlashVars seemed the easiest way to do this.  You
could easily pull in URL or Form variables the same way.  I would
assume it's just as easy to do this useing ASP or PHP to produce the
dynamic FlashVars list.

In any case, my CF template (which I haven't finished) looks like this:

<!--- Create the FlashVars string.  createFlashVars() returns name/value
       pairs separated by & --->
<cfset flashVarObject = createObject
("component","components.utilities.flashUtils")>
<cfset request.flashVars = flashVarObject.createFlashVars (foo)>
...
} else if (hasRequestedVersion) {
   // if we've detected an acceptable version
   // embed the Flash Content SWF when all tests are passed
   AC_FL_RunContent(
         "src", "#myFlexAppSource#",
         "width", "100%",
         "height", "100%",
         "align", "middle",
         "id", "#myFlexAppID#",
         "quality", "high",
         "bgcolor", "##ffffff",
         "name", "#myFlexAppName#",
         "flashvars",'historyUrl=history.htm%3F&lconid=' + lc_id + '',
         <cfif isDefined
("request.flashVars")>"flashvars",'#request.flashVars#',</cfif>
         "allowScriptAccess","sameDomain",
         "type", "application/x-shockwave-flash",
         "pluginspage", "http://www.adobe.com/go/getflashplayer";
   );

createFlashVars() pulls an application-specific list of variable
values to include int he FlashVars list.  I also have logic that uses
request-scoped variables to determin which swf to load.  I haven't
finished this process yet, thus the lack of CF code.  I'm setting many
of the values manually in the template until I have time to autmoate
more of the process.

All that said, I'm new to Flex so I don't know if there is an easier
way to pull dynamically-selected environmental values form Flex.  This
way seemed easy to me.

Adam


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to