RE: [flexcoders] Remote objects and when they exist
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: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of mehere_straker Sent: Monday, September 19, 2005 11:13 PM To: flexcoders@yahoogroups.com 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/
Re: [flexcoders] Remote objects and when they exist
true that was a typo in my example. I seem to have got it going by doing an init() on bob I *think* this may be something to do with that my root MXML element is mx:Box What do use for the root element if you are writing a MXML file as a class? On 9/21/05, Peter Farland [EMAIL PROTECTED] wrote: 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: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of mehere_straker Sent: Monday, September 19, 2005 11:13 PM To: flexcoders@yahoogroups.com 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? -- 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 -- 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 Visit your group flexcoders on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Yahoo! Groups Sponsor ~-- Most low income households are not online. Help bridge the digital divide today! http://us.click.yahoo.com/cd_AJB/QnQLAA/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/
RE: [flexcoders] Remote objects and when they exist
What do use for the root element... That depends on what your mxml component is going to do. To date, there is no faceless mxml component to extend for non-visible work. Box is ok, Canvas is probably the lightest weight component. Do you have to instantiate with AS? You could declare the remoteobject in some existing mxml file, and then do all the real work in AS, like building the method parameters and invoking the send. Tracy -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of David Harris Sent: Tuesday, September 20, 2005 3:50 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Remote objects and when they exist true that was a typo in my example. I seem to have got it going by doing an init() on bob I *think* this may be something to do with that my root MXML element is mx:Box What do use for the root element if you are writing a MXML file as a class? On 9/21/05, Peter Farland [EMAIL PROTECTED] wrote: 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: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of mehere_straker Sent: Monday, September 19, 2005 11:13 PM To: flexcoders@yahoogroups.com 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? -- 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 -- 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 Visit your group flexcoders on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. -- 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/