Extending HorizontalLayout to Support Baseline (Align to Text)

February 26th, 2010 1 comment

hlayoutbaselineThe current Spark HorizontalLayout unfortunately doesn’t support baseline alignment. If I want to have, for example, a Label and a Button positioned so that their text aligns, I usualy use absolute position (nudging things up or down) or baseline constraints with BasicLayout/Canvas. But then again, I always find myself needing this feature in a HorizontalLayout and so I finally decided to tackle it on. It turns out it’s pretty easy to extend the stock Spark HorizontalLayout, not to mention using it is a breeze with the Spark layout architecture (yay Spark!). Read more…

VerticalAlign for VGroup and HorizontalAlign for HGroup

January 24th, 2010 3 comments

majoraxisalignment Recently I checked in the major axis alignment update to VGroup, HGroup, VerticalLayout, HorizontalLayout. It brings parity to the Flex 4 Spark layouts relative to the MX containers HBox and VBox that are well known from previous versions of Flex (and have had those alignment options for long time now). Read more…

Drag and Drop Skinning in Spark

January 18th, 2010 7 comments

dndlistskinning

Customize the ItemRenderer’s “dragging” state.  The drag indicator is the image that the user sees when they select and item and drag it away from the source container. By default the Spark List creates a drag indicator by duplicating all the ItemRenderers for the items being dragged. Therefore a natural way to customize the drag indicator is by customizing the ItemRenderer skin. Spark makes that easy by introducing the  optional “dragging” state.
Customize the List’s optional “dropIndicator” skin part.  The drop indicator is the image that the user sees as an indicator of where the dragged items are going to be inserted in the destination container.  By default, the Spark List displays a horizontal/vertical line along the gap between the at the insertion point.  Spark makes that easy by automatically managing the “dropIndicator” optional dynamic skin part.

Read more…

Calculating the Projected Bounds using Utils3D.projectVector()

December 15th, 2009 No comments

projectedboundsIf you are playing with objects in 3D and want their projected bounds, there’s a neat flash functionality for that - Utils3D.projectVector(). However it may not be that apparent how to use it. Here I’m showing a small helper function that does the trick.
Read more…

Spark Layouts with Flex 4 Beta

October 11th, 2009 7 comments

Just a quick post to link to my layouts  article on the Adobe dev connection. It uses the same FlowLayout as an example, so no surprises in that department. Check it out, comments and feedback greatly appreciated.

Tags:

WheelLayout Source and Quick Mashup

June 26th, 2009 4 comments

A few folks have been asking for the source code of the WheelLayout. I created it as a proof-of-concept that our Spark layout APIs are sufficient for creation of 3D layouts. And just to showcase it in action, I decided to grab quickly the Flex3 Halo FlickrRIA, port it to Flex 4, and mash it up with the WheelLayout.

wheellayout

Check Out Hans’s Article on Spark Viewports and Scrolling

June 19th, 2009 1 comment

Just a quick note that Hans Muller has started a seriese  of articles regarding Flex on his blog. His spiffy article  here  has some very good info about the Spark Viewports and Scrolling :)

Also you can check out how little I had to do to implement scrolling support in a custom layout here.

Enjoy!

Tags:

FlowLayout Part 2 - Gap, VerticalAlign and Scrolling

June 10th, 2009 11 comments

In part one here, the FlowLayout had really basic functionality.  I decided to demonstrate how to add layout properties to the custom Spark layouts and how to enable scrolling.

Read more…

FlowLayout - a Spark Custom Layout Example

June 1st, 2009 26 comments

I’ve been working on the Flex SDK team for more than a year now, primarily playing with the Spark layouts.  One of the new Spark features is the “assignable layouts”.  The stock layouts have been separated into their own classes and the containers can be assigned different layouts at run-time.  This modularization allows anyone to create their own cool custom layouts and use them with any of the Spark containers.

Read more…

Tags: ,