On 4/15/05, Mark Kecko <[EMAIL PROTECTED]> wrote:
> So I changed all of my instance variables inside my component to the
> variables scope.  After I did this everything seemed to work fine until
> I tried to reference my member object.  I'm calling the object with
> invoke in my FB4.1 circuit file like:
> 
> <invoke class="member" methodcall="get(url.memberid)"
> returnVariable="member" />
> 
> I used to reference my object on my dsp pages like member.fname and
> member.lname (when I was using the instance scope) but now that doesn't
> work anymore.  I get fname is undefined in member.

Right, you need accessors / getters:

<cffunction name="getFirstName" returntype="string" access="public"
output="false">
    <cfreturn variables.fname />
</cffunction>

Then in your dsp pages you say member.getFirstName() instead.

Better encapsulation - makes the object effectively readonly.
-- 
Sean A Corfield -- http://corfield.org/
Team Fusebox -- http://fusebox.org/
Got Gmail? -- I have 50, yes 50, invites to give away!

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Purchase Studio MX with Flash Pro from House of Fusion, a Macromedia Authorized 
Affiliate and support the CF community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=51

Message: http://www.houseoffusion.com/lists.cfm/link=i:12:6742
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/12
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:12
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.12
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to