Question
Using the ServiceLocator
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
