29/09/2008

Using Flex directly with Squeak

Thierry Thelliez has been doing some experiments, trying to integrate Flex with Seaside. I am interested in this too. He has now worked out how to pass data to a Flex component, embedded in a Seaside page.



I found the solution:

The FLEX HTTPService is encoding the request URL and that's not
playing well with Seaside style.

I found another way to do it with a FLEX URLLoader (code sample
below). So far so good. The FLEX widget can talk back to Seaside to a
dynamic URL, get back some XML data and draw whatever FLEX can offer
(datagrid, charts,...). Cool. (Next step for me: https support?)

Thanks again.
Thierry


On the MXML side:

private var myLoader:URLLoader = new URLLoader();
...
private function initApp():void {
...
var request:URLRequest = new URLRequest(aSeasideURL);
myLoader.addEventListener(Event.COMPLETE, onLoaded);
myLoader.load(request);

private function onLoaded(event:Event):void {
sourceXML = XML(myLoader.data);
}
...
private function onLoaded(event:Event):void {
sourceXML = XML(myLoader.data);
}
...

...


No comments: