isAdmin is a function... So you need to use parentheses () to invoke it,
even when there are no arguments.
public function loadPerms():Void
{
srvPermissions.isAdmin()
}
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of mehere_straker
Sent: Monday, September 19, 2005 11:13 PM
To: [email protected]
Subject: [flexcoders] Remote objects and when they exist
Hi,
I am quite new to Flex and action script, but have a problem I hope
someone out there can help with...
I have a "class" which is a "mxml" file called "Permissions".
The idea is that when the Flex app starts up, it goes off to a
Coldfusion CFC via a RemoteObject and gets the various rights of the
current loggin and loads them in to an application wide scope to be
avalible to the application.
Example Code:
======================================
<!-- in the root mxml file -->
function appInit():Void{
var bob = new com.classes.Permissions;
_global.permissions = bob.loadPerms(); }
======================================
<!-- in the Permissions.mxml -->
<mx:RemoteObject id="srvPermissions"
source="[my source]"
fault="srvFaultHandle(event.fault.faultstring)"
showBusyCursor="true">
<mx:method name="isAdmin" result="isAdminResult(event)"/>
</mx:RemoteObject> <mx:Script>
<![CDATA[
public function loadPerms():Void{
srvPermissions.isAdmin
}
private function isAdminResult(event):Void{
trace("function isAdminResult(event) -- You got a Result!");
}
private function srvFaultHandle(message:String):Void{
trace("ERROR:: " + message);
}
]]>
</mx:Script>
=======================================
>From what I can see, putting various traces all over the place, even
though I have created a object of class "permissions", it doesn't exist,
and when I (try) and fire the remote object, nothing happens, not in the
error handler or event handler.
Can anyone see what I am doing wrong?
------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~->
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~->
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/