Use <cfinvoke>
-----Original Message-----
From: Andy Matthews [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 14, 2006 12:17 PM
To: CF-Talk
Subject: Dynamically calling methods in a CFC
I'm using Rick Root's image.cfc which contains scaleX and scaleY
methods.
Right now I'm doing an if statement with two lines for the call to the
CFC.
<cfif scaleMethod IS "scaleX">
<cfset a = APPLICATION.imgObj.scaleX()> <cfelse>
<cfset a = APPLICATION.imgObj.scaleY()> </cfif>
But I'd like to condense it to this:
<cfset a = APPLICATION.imgObj[scaleMethod]()>
But that method errors. I've tried these as well:
<cfset a = APPLICATION.imgObj["#scaleMethod#"]()>
<cfset a = APPLICATION.imgObj."#scaleMethod#"()>
<cfset a = APPLICATION.imgObj.#scaleMethod#()>
But they also failed. I know it's got to be possible, but I'm not sure
how to do it...anyone?
<!----------------//------
andy matthews
web developer
certified advanced coldfusion programmer ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:253128
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4