I want to have all my RemoteObject declarations in a mxml component that I can later use in another application. I created a services.mxml file where I have something like this:
<?xml version="1.0" encoding="utf-8"?> <mx:Canvas xmlns:mx="http://www.macromedia.com/2003/mxml"> <!-- ========================services.mxml=========================== --> <!-- ==================================================================== --> <!-- Remote Java Objects --> <!-- ==================================================================== --> <mx:RemoteObject id="myRemoteObject" source="com.remote.object" result="event.call.resultHandler(event.result)"> <mx:method name="getMyData"></mx:method> </mx:RemoteObject> <!-- ==================================================================== --> <!-- Web Services --> <!-- ==================================================================== --> <!-- ==================================================================== --> <!-- HTTP Services --> <!-- ==================================================================== --> </mx:Canvas> Then I call it like this: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" xmlns:i2="*"> <mx:Script> <![CDATA[ public var myList:Array= new Array(); // Remote call to getMyData in the Java service. Handler below private function getMyList(): Void { var category:String="something"; var pendingCall = services.myRemoteObject.getMyData(category); pendingCall.resultHandler = mx.utils.Delegate.create(this,resultHandler) } function resultHandler(result): Void { myList= result; } ]]> </mx:Script> <!-- ======================================================================== --> <!-- View --> <!-- ======================================================================== --> <mx:ComboBox dataProvider="{myList}" id="cb_1" initialize="getMyList()" width="200" /> <!-- ==================================================================== --> <!-- Remote Java Objects --> <!-- ==================================================================== --> <i2:services id="services" /> </mx:Application> However I get this error message: The property being referenced does not have the static attribute. I have tried to call it like this, var pendingCall = mx.core.Application.application.services.myRemoteObject.getMyData(category); which doesn't give any error but doesn't return any data. Any ideas? Thanks --------------------------------------------------------------------------- This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender and erase this e-mail message immediately. --------------------------------------------------------------------------- ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12he8hip7/M=362329.6886308.7839368.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1124213196/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992 ">Fair play? Video games influencing politics. Click and talk back!</a>.</font> --------------------------------------------------------------------~-> -- 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/

