• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

ColdFusion and Flex

Guest
Oct 06, 2006 Oct 06, 2006

Copy link to clipboard

Copied

Ok - so I've spent months on this really cool Flex app, everything works to this point, and I know what I want to do next, but can't find anywhere on the net that will describe how to do it.

I have a ColdFusion website, and one of the pages will serve up the lovely .swf all that i've made. The problem is: how to I pass variables from the ColdFusion site (because it knows who you are logged in as) to the Flex application (because it needs to write to a database based on who you are, but it doens't know who you are).

At this point, I have two folders on my server - on for the coldfusion site, and one that I've developed my Flex app in, and I've been inserting the .swf file into my CF page, so it plays the movie, but I can't figure out how to pass a variable around.

And, do all my .mxml and .as files need to be in the same directory as my CF pages for everyone to play nice?? I thought I had done so well to create the app, but now I don't know how to get it out to the people who need it!

Thanks in advance (I have also posted this in the Flex forums, hoping someone somewhere will have an answer!)

Jenn
TOPICS
Advanced techniques

Views

403

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 06, 2006 Oct 06, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 06, 2006 Oct 06, 2006

Copy link to clipboard

Copied

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!
Jenn

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 06, 2006 Oct 06, 2006

Copy link to clipboard

Copied

This all just seems so confusing to me right now - two working pages,
but I need them to become one.

Thanks for your help!
Jenn

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
you.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 10, 2006 Oct 10, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 17, 2006 Oct 17, 2006

Copy link to clipboard

Copied

LATEST
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
{
var name:string=Application.application.parameters.NAME
}

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.

Thanks!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation