> I use cfobject to instantiate my components in my > Application.cfm file. > > <cfobject name="test1obj" component="cfc/test1"> <cfobject > name="test2obj" component="cfc/test2"> > > Can I use test1.cfc to call a method from test2.cfc? > > In a typical ".cfm" page I would invoke the component like > this, <cfinvoke component="#test2obj#"... > > > However, if I use this same code inside of test1.cfc, I get > the error "Variable test2obj is undefined". > > Is there a way I can create the object so that it is > available to use in a CFC?
CFC instances are just like any other variables in this regard. If you want to have a variable available in a CF program, it either has to be local to that program or in one of the scopes that is accessible from that program. So, you can either put the variables in the Application or Session or Request scopes, or you can pass the value you want to the CFC as a parameter, so that it can be used locally within the CFC. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306623 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4