//Define your call
ro = new RemoteObject;
ro.destination = "getDataService";
//make the call to the server
//Handle the result.
private function getDataResultHandler(event:ResultEvent):void
myArrayCollection = new ArrayCollection(event.result as Array);
So now your data sites in myArrayCollection, and you can do whatever you like with it.
I appreciate your reply. What you suggest is certainly correct, but what I am looking for is something else, so let me elaborate, in case you or someone else wants to contribute other ideas.
In a recent catalog project I did with FB 3, I created a service – an MXML custom component based on UIComponent. That RemoteObject service was only written once, but was called from four other components to get different datasets from different database tables. This works very well.
When I saw that FB 4 can create a service, I thought that would be a good way to save time – not having to write a service component, but just introspecting a CFC and creating the service in seconds. The idea would be to capture the data generated by calls to this service and save it in collections for later use. My service was an MXML file of 4950 bytes; the service created by FB 4 was in two files totaling 5500 bytes – so far , so good.
But now, looking a little deeper, I find that the value object created by FB 4 takes three AS files, total size 50800 bytes. My own value object for the same thing is one 860 byte AS file. Plus, so far, I have not been able to find out how to capture that data to save it – or even how to see it in the debugger.
<s:Remoteobject> is available, so I guess I will keep doing these things as before, unless somebody points out something I have been missing.
It pisses me off a little to see that all the articles – from Adobe & others – available out there are all about how cool this “data-centric development” is, but they don’t really contain any meaningful documentation. It’s all designed to dazzle you with BS, but there is no real information. For example, shouldn’t these articles point out – to the prospective suckees – that somebody, at some point is going to have to write a goof CFC, or PHP template, or whatever?
This reminds me a lot of when Macromedia released Dreamweaver UltraDev – now, nobody had to even know ColdFusion existed, but a short-order cook could all of a sudden create CF applications “without writing one single line of code” (Anybody aver see the code UltraDev generated?). This data-centric BS is the same thing.
I think I will be making my FB 4 trial a full license. But it ain’t gonna be because of its data-centricism; it will be for the new easier styling and skinning – that part is very good.
Adobe, are you sure there isn’t a typo in there somewhere? Sometimes it feels like your “Developer Center” should really be called “Marketing Center”.
Best regards to all,
1 person found this helpful
I find the problem with the new data-centric aspects is that they are not aimed at seasoned developers who want to get at the core of what is going on. They are aimed at RAD developers and script-kiddies.
I am trying to consume a WSDL for AmazonS3 using the data-centric features and have been hitting brick wall after brick wall, to the point where it has been a complete waste of time and I could have manually coded the service.
I searched online for help with using the data-centric aspects and also found nothing other than binding data to a UI component...but what about authentication? Flash Player now no longer allows a RESTful connection to the service because of all the disallowed header responses. And using GET is no good at all because Flash Player strips all the headers before it even makes the request.
I am really looking to get my hands dirty with SOAP and Flex 4 but cannot find anything more than kids stuff in ADC.
So now after a full day or bad blog posts, I am going to have to turn to PHP and build a proxy.
I played with this thing some more, but was never able to find out how to access the data in the service created by FB 4, so I decided to do a test: I created a second version of the little project referred to in my original post, with one difference: instead of creating the service and binding the result to a tile list by dragging it in design view as directed in the “data-centric” sample app, I created the service as a custom component extending the mx:UIComponent – everything else stayed the same as before.
I was not surprised to find the following:
the “data-centric” debug SWF size = 114,953 bytes;
the custom component debug SWF size = 93,113 bytes;
the “data-centric” release SWF = 65,503 bytes;
the custom component release SWF = 54,679 bytes.
So, the data-centric SWFs end up 20 – 23% bigger than the ones fromm the MXML custom component. Also, now I have the data in an ArrayCollection and can use it in other places any time I need it.
So much for this cool and dazzling data-centric BS.
If anyone thinks I am missing something, please let me know.