October 22, 2008

Advanced CSS Selector

With the Flex SDK Gumbo alpha release almost ready, I wanted to blog about the new advanced CSS selector capabilities.

We've added support for descendant selectors, class conditions for type selectors (previously class conditions were only registerd by themselves at the top level, i.e. "globally" instead of on a type by type basis), and id conditions for both type selectors as well as globally. These selectors were chosen as they were seen as the most requested by the community.

A few known issues that will be fixed shortly after alpha include allowing combinations of conditions at the top level (e.g. a top level id and class selector together in a selector chain, ".specialButton#button12");

July 3, 2008

Targeting XMLSchema subtypes for anonymous ActionScript Objects

When encoding ActionScript objects to XML using a schema, such as when using a SOAP based WebService, it is not uncommon to provide a subtype (say, an Employee class) to an API that merely specifies a base type (say, a Person class). An issue is that the encoder does not know the subtype that your value is targeting so you must provide a hint. For the decoding XML to ActionScript case, an xsi:type attribute provides the decoder with such a hint... so an equivalent is needed in ActionScript for the encoding XML case.

For strongly typed objects, you can implement the mx.rpc.xml.IXMLSchemaInstance interface to provide a QName for the xsiType property to target the subclass to be used during encoding. See: http://livedocs.adobe.com/flex/3/langref/mx/rpc/xml/IXMLSchemaInstance.html#xsiType

For anonymous ActionScript Objects, however, you may not know that you can wrap your object in an mx.utils.ObjectProxy instance and set its type property with a QName to achieve the same effect. See: http://livedocs.adobe.com/flex/3/langref/mx/utils/ObjectProxy.html#type

Continue reading "Targeting XMLSchema subtypes for anonymous ActionScript Objects" »

June 21, 2008

Using AMF with flash.net.URLLoader

flash.net.NetConnection is a native Flash Player class that is the workhorse for AMF based communication. Flash and Flex applications make use of NetConnection to send AMF formatted requests over HTTP or HTTPS to servers such as Flash Remoting, ColdFusion, BlazeDS, etc. However, less HTTP features are exposed by NetConnection than those of flash.net.URLLoader.

This can be a pain when your network architecture has one or more firewalls between external Flash Player clients and your application server. If authentication or session management is performed at the firewall, session timeouts can introduce an annoying problem. If a client makes an AMF request after a session has timed out, the session management layer may challenge the client to re-authenticate. This challenge is unlikely to be an AMF formatted response and so NetConnection is unable to process the information. While the client knows the request failed, the exact cause of failure is not known.

So... I hacked together a prototype replacement for NetConnection based on flash.net.URLLoader. This new "AMFConnection" class creates binary flash.net.URLRequests and sends HTTP POST data as an AMF formatted request and processes the AMF formatted response returned to URLLoader. One could subclass AMFConnection and intercept the response data and try to detect that an HTML re-authentication page has been returned to the client.

Continue reading "Using AMF with flash.net.URLLoader" »

April 3, 2008

Flex User Group Boston

I'm looking forward to catching up with the Boston Flex User Group on next Tuesday, 8th April at 7pm.

http://www.bostonfug.org/

I'll be speaking at this event, most of the demonstration will be hands on, but my slides as a PDF are here:

Download file

February 25, 2008

AIR, Flex 3, BlazeDS, and a new Adobe Open Source site!

Check out Flex 3 SDK and BlazeDS releases on Adobe's new Open Source site!

http://opensource.adobe.com/

Flex Builder 3 is live too!

http://www.adobe.com/products/flex/


But wait, there's more! AIR 1.0 is also live:

http://www.adobe.com/products/air/

Woo hoo!