you just need to make sure your application.cfm/cfc is in a folder above the cfc's. CF uses the same rules to find the application.cfm/cfc when invoking a cfc directly from flex as it does when its looking for the application.cfm/cfc when you invoke a cfm page. It walks up the folder tree to find it.
Most likely you have an application.cfm in the folder with your test cfm pages, but that is not in a folder above the cfcs so when you invoke the cfc directly ColdFusion can't find the same application.cfm. hth, ---nimer ________________________________ From: Paul Kukiel <[email protected]> To: flex <[email protected]> Sent: Friday, February 20, 2009 6:29:12 PM Subject: RE: CFCs called from Flex are no t seeing APPLICAT ION, SESSION, or other shared-scope va riable sâ⬠David, Thatâs actually not correct. Flex remoting works in the same way as a normal cfm. You have full access to application and session scoping even if you just directly access a cfc. Paul -----Original Message----- From: David Henry [mailto:[email protected]] Sent: Friday, February 20, 2009 5:13 PM To: flex Subject: Re: CFCs called from Flex are not seeing APPLICAT ION, SESSION, or other shared-scope va riablesâ⬠Jordan, Someone correct me if I'm wrong. I think calling a cfc directly will bypass the Application.cfm or Application.cfc file. This means there is no context for the application or session scope because the cfapplication tag was probably skipped. Hope that helps, David Jordan Farr wrote: > Hello all, > > When I call my CFCs (CF8) using CFML from a CFM page, I can access > APPLICATION and SESSION variables no problem (i.e. the CFC is aware that it > is part of a given application that has some session variables). However, a > Flash movie built with Flex 3, sitting on the same CFM page as my working > CFML code, calling the same CFC as my CFML code, does not work because it > says that variables APPLICATION, SESSION, etc are undefined. > > I am not sure how to fix this issue. > > I know the CFC is accessible from the Flash movie because if I change the CFC > code to return a string "Hello World!" and ask the Flash movie to > Alert.show() it, it shows "Hello World!", so the lines of communications are > open. It is as if when a CFC is called via Flash remoting from Flex (I'm > using Remote Objects in Flex), the CFC doesn't know it is part of an > Application instance and instead acts statically. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/flex/message.cfm/messageid:5785 Subscription: http://www.houseoffusion.com/groups/flex/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37
