Skip to main content
Participant
September 11, 2008
Question

Using the ServiceLocator

  • September 11, 2008
  • 2 replies
  • 1001 views
Hi all,<br /><br />i'm new to Cairngorm and also quite new to Flex, and i'm having<br />some troubles understanding how to use the ServiceLocator.<br /><br />As far as i've understood the ServiceLocator is a centralized point<br />for communication with the Server.<br /><br />What i'm trying to do is request an xml file from a specific url, but i'd need to pass a parameter to that url. In all the examples found in the docs the urls were hardcoded.<br /><br />So that's how i tried to solve it:<br /><br /><?xml version="1.0" encoding="utf-8"?><br /><rds:ServiceLocator xmlns:rds="com.adobe.cairngorm.business.*" xmlns:mx="http://www.adobe.com/2006/mxml"><br /><br /> <mx:HTTPService id="xmlIn" url="{'http://example.com/someScript.php/id/'+ id}"/><br /> <br /> <mx:Script><br /> <br /> <br /> [Bindable] public var id:Number;<br /> <br /> </mx:Script><br /> <br /></rds:ServiceLocator><br /><br />In the delegate, i would simply assign a value to __locator.id, which cannot be resolved by the flex compiler since __locator is a reference i got from ServiceLocator.getInstance().<br /><br />I'd be grateful for any hint on how to solve this the cairngorm way, thanks!<br /><br />-robert
This topic has been closed for replies.

2 replies

Participating Frequently
September 24, 2008
Hey Rober, send me an email and I'll walk you through this offline: ericATericfeminella.com

Best,
Eric
Participating Frequently
September 24, 2008
Hi Rober,
Sorry, but this forum is for discussing the future of cairngorm, not how to use it today.

I suggest you post your question on the FlexCoders mailing list or on the Cairngorm Documentation Group :
http://tech.groups.yahoo.com/group/cairngorm-documentation/

Thanks :)