This content has been marked as final. Show 5 replies
There are many ways to do this. For one, you can use ColdFusion CFCs
and Flex <mx:RemoteObject ...> to pass data back and forth. Is that
enough of an idea for you, or do you need some more how to?
I'm by no means an expert on my Flex and CF interactions yet. But I
have built a small app that passes some data back and forth between my
ColdFusion and Flex logic.
I'll need a bit more of an idea than that. I'm already using CFCs to talk to the database, but the CFCs used by my .mxml page are in a different location than the CFCs used by my cfm pages. And the .cfm pages have a variable value that I'd like to tell the .mxml page so that it can do queries based on the value (the CFCs don't know this value yet because it's two sets of CFCs that I'm working with).
This all just seems so confusing to me right now - two working pages, but I need them to become one.
Thanks for your help!
This all just seems so confusing to me right now - two working pages,
but I need them to become one.
Thanks for your help!
I would guess that you do need to get the two pages working from one
backend set of CFCs, even though those CFCs do not need to all live in
one location, but that is probably the easiest to manage.
You may need to make your CFM front end use some CFCs for the data
abstraction that the flex can then also make use of.
I would also speculate that Flex can make some use of URL parameters,
but I have never done this. And I do not know if this would really help
Jenn, I may be misreading this, but it seems you want to pass CF variable information in the Flex .swf. If so, the easiest way is to pass the CF values as FlashVars. I have a custom wrapper I'm working on to integrate Flex apps with some CF apps I'm currently running. I use an object to create a string variable (request.flashVars) that I pass to the call to run the swf (AC_FL_RunContent).
Flashvars need to be passed as a string that looks like "name1=value1&name2=value2..." The variable name and value need to be URL encoded and the ampersand is used to separate name/value pairs.
Hope this helps.
Thanks for your help - FlashVars were the answer! What I did was insert a .swf object, and used the params
<param name="FlashVars" value="NAME=<cfoutput>#value#</cfoutput>" />
and on the Flex side, i put initialize="setvars()" in the application tag at the top, and then created
public function setvars():void
and it all just kinda worked...I'm sure there is more to this than just what I've done, but for what I needed, this will do the trick.