Web application R&D notes, from the world of Java, Flex, CSS, XHTML, Flash, .NET, cross-browser compatibility, JavaScript, AJAX, ADA compliance, Photoshop, and any and all things related to Web development!
Showing posts with label adobe. Show all posts
Showing posts with label adobe. Show all posts
01 August 2011
18 March 2011
08 March 2011
Adobe's Wallaby ties Flash to HTML
Promising tech from Adobe for Flash conversion to HTML5: http://www.infoworld.com/d/application-development/adobes-wallaby-ties-flash-html-715
28 October 2010
31 May 2010
24 May 2010
19 May 2010
05 May 2010
Adobe CS5: great reason to move to a 64-bit OS
The latest Adobe Creative Suite contains apps that will require 64-bit operating systems; the two apps include Premiere Pro and After Effects. So if you've been sitting on the fence about 64-bit OSes, now's the time to make the move.
26 February 2010
18 December 2009
22 September 2008
Adobe CS4 Launch Event
Hi, all. Adobe will launch their CS4 Suite on Tuesday, 9 a.m. Pacific Time. You can get details on the BrilliantEvent site.
Flex 4 - Download the Beta SDK
Flex 4, codenamed "Gumbo," is available for download from Adobe's OpenSource site. To get it installed and running in Flex Builder 3, you can use the tutorial at FlexExamples.
The Power of Flex's resultFormat E4X
While researching how to bind XML data to a Flex AdvancedDataGrid, I saw various examples that had the data converted to array objects. That might have been the only way to work with XML prior to ActionScript 3.0. Now however, a new set of classes and functionality, known as E4X (ECMAScript-for-XML), make life easier for developers.
Playing around, I discovered that, on the HTTPService object, a simple property allows the data to be accessible via simple XML calls,
This enables your datagrid's columns' dataField to simply have your XML element or attribute name as its value. For example, to read an id attribute off of the root element of your XML, you'd use dataField="@id".
Playing around, I discovered that, on the HTTPService object, a simple property allows the data to be accessible via simple XML calls,
service.resultFormat = "e4x";
This enables your datagrid's columns' dataField to simply have your XML element or attribute name as its value. For example, to read an id attribute off of the root element of your XML, you'd use dataField="@id".
Flex and XML - Don't Forget the ContentType
Hi, all. Hope everyone had a great weekend. I came across an interesting problem last week with Flex 3: A Java servlet produced perfectly fine XML via the SAX (Simple API for XML) package, but the SWF file kept having a hiccup when it tried to read the data,
In the above code, I changed the FaultEvent handler to display an object as an ErrorMessage, as per Sujit's great article. Finally, it showed the error,
Hmm. Flex errors can sometimes be tricky. A quick check on a Flex error lookup tool, and this page provided some answers, though not what I thought. One person had posted about having to remove the contentType from the HTTPService object. Mine was missing it. So I added it and voila! Flex fetched the data with no errors.
A little more digging and I realized that my Java servlet was emitting XML data, with the contentType set to "text/xml". Flex needed that hint of what data to expect. So adding this line to the useHTTPService() method fixed the headache,
private function useHttpService():void {
service = new HTTPService();
service.url = "http://myserver/myServlet";
service.method = "POST";
service.addEventListener("result", httpResult);
service.addEventListener("fault", httpFault);
service.send();
}
private function httpResult(event:ResultEvent):void {
premiums = XML(event.result);
// Read the XML directly (E4X) in the datagrid.
this.dgPremiums.dataProvider = premiums.premium;
}
// Fetch the rootCause and display in Alert.
private function httpFault(event:FaultEvent):void {
var errorMessage:ErrorMessage = event.message as ErrorMessage;
Alert.show("rootCause: " + errorMessage.rootCause.toString());
}
service = new HTTPService();
service.url = "http://myserver/myServlet";
service.method = "POST";
service.addEventListener("result", httpResult);
service.addEventListener("fault", httpFault);
service.send();
}
private function httpResult(event:ResultEvent):void {
premiums = XML(event.result);
// Read the XML directly (E4X) in the datagrid.
this.dgPremiums.dataProvider = premiums.premium;
}
// Fetch the rootCause and display in Alert.
private function httpFault(event:FaultEvent):void {
var errorMessage:ErrorMessage = event.message as ErrorMessage;
Alert.show("rootCause: " + errorMessage.rootCause.toString());
}
In the above code, I changed the FaultEvent handler to display an object as an ErrorMessage, as per Sujit's great article. Finally, it showed the error,
IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: myServlet"
Hmm. Flex errors can sometimes be tricky. A quick check on a Flex error lookup tool, and this page provided some answers, though not what I thought. One person had posted about having to remove the contentType from the HTTPService object. Mine was missing it. So I added it and voila! Flex fetched the data with no errors.
A little more digging and I realized that my Java servlet was emitting XML data, with the contentType set to "text/xml". Flex needed that hint of what data to expect. So adding this line to the useHTTPService() method fixed the headache,
service.contentType = "application/xml"; // Must have this or will get IOError -- servlet generates XML document.
Labels:
adobe,
contenttype,
exceptions,
flex,
httpservice,
rootcause,
servlet,
xml
Subscribe to:
Posts (Atom)