I am writing a small flex application that will, eventually, call PHP services to perform its work. In the meantime, however, I would like to have it use local data in XML form to allow me to develop the Flex part independently of the data service.
What is the best way to do this?
I want to emulate a service like this:
public class Service {
public function getIssues(project:String):ArrayCollection {}
public function addIssue(issue:Issue):void {}
// ...
}
Suppose I have the data stored in assets/
:
assets/_project1_.data.xml
assets/_project2_.data.xml
assets/_project3_.data.xml
If I only ever needed to load one, I'd do the following:
<mx:HTTPService id="issueService"
url="assets/issues.xml"
fault="serviceFaultHandler(event)"
result="issueResultHandler(event)"/>
And invoke the service using issuerService.send()
, populating my results as expected. How do I do this as though it were a RemoteObject
instead, but keep my data local?