Advanced CSS Selector

| No Comments

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");

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

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.

Flex User Group Boston

| No Comments

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

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!

Recent Comments

  • Pete: Also Urs, I have not tested it with AMFPHP... but read more
  • Pete: There are several implementations of AMF 3 for .NET. Fluorine read more
  • Pete: The Flash Player's flash.net.URLLoader class only supports HTTP methods GET read more
  • Dan Mayolo: It has been some time since your post but I read more
  • J: Hi, Can you kindly let me know how can an read more
  • Urs: Hi Pete! Great work, but I have a problem using read more
  • Peter Farland: I think that's just an odd behavior of the player, read more
  • gordon: hi ,pete . it seems byteArray.writeObject(['a','a']); Serialize a strict array read more
  • Frank Young: I'm trying to utilize a SOAP webservice that uses abstract read more
  • Peter Farland: I ran a quick test and it seems that String.fromCharCode() read more

Find recent content on the main index or look in the archives to find all content.