February 2007 Archives

Announcing FlexLib

| 2 Comments

For about the past month, Doug McCune, Ted Patrick, Mike Chambers and I have been collaborating on an open source community-driven Flex 2 component library. Today, we're pleased to announce the opening of FlexLib!

Interestingly enough, just the other day Mrinal Wadhwa announced FlexBox, a directory of Flex 2 components. FlexLib looks to take this a step further.

FlexLib is a Google Code project that aims at being a concentrated effort by the Flex 2 community for creating high quality user interface components. FlexLib provides a standard component namespace, package structure, code and naming conventions, and common reusable base classes to unify the various efforts people have put forth on their own.

Most of the content currently in FlexLib reflects Doug's work. I've added a few things here and there, but so far the bulk of the offerings have been gathered from his archives. Going forward, new components that I release on my weblog will be released as part of the FlexLib library. I hope that other component authors follow suit and join in our efforts.

Where to go from here:

Installing Flash Player 9 on 64 bit Linux

| 4 Comments | No TrackBacks

Every time Flash and Linux are mentioned breath, someone surely responds with "but Flash Player 9 doesn't run on 64 bit Linux." Sure it does... and you can install it with one line.

For some background... I dual boot my laptop with openSUSE 10.2 64-bit (x86_64). I love using Linux.. I want to use Linux and it's emerging technologies like XGL. It's fun, and I enjoy the level of customization available. I've been trying to make the switch to Linux full-time, but I'm too reliant on Adobe's FlexBuilder, and unfortunately there isn't a Linux version. With a bit of hacking, a Chinese blogger managed to get FlexBuilder 2.0.1 to run on Linux, but I don't think that's a usable (or even legal?) solution.

I can still use the free command line SDK to compile and run Flex 2 applications though, so all is not lost.

Anyway, I digress... enough rambling. As James already mentioned, getting Flash Player 9 to run on 64 bit Linux really isn't that hard. His post demonstrates the installation process of Flash Player 9 using Gentoo Linux. Since I'm using a different disto, the steps are slightly different. Are you ready?

  • sudo cp libflashplayer.so /usr/lib/browser-plugins/libflashplayer.so

That's is. One line. Granted, the very first step, which I've omitted, is to download the tarball from the Adobe website - http://www.adobe.com/go/getflash - and extract it so you can copy the file... but there it is, in one easy line.

That's all I had to do to get the 32 bit Flash Player 9 to run on 64 bit Linux. It runs my Flex 2 applications just fine, and works great in all of the testing I've done. It's probably slower than if it were a native 64-bit binary.. but really, I didn't have to do anything in regards to the Netscape Plugin Wrapper or worry about any of the 32 bit / 64 bit incompatibilities.

"It just worked" - and that's the way it should be.

Update: As of November 2008, Adobe has released a beta version of a 64-bit Flash Player 10 for the Linux Platform. More information here: http://www.kaourantin.net/2008/11/64-bits.html.

I've created a new DataGrid component, one that I call the AdvancedDataGrid, that let's you do some amazing things with data hierarchies in Flex 2.

A picture is worth a thousand words, so check out the AdvancedDataGrid demo that I put together here.

What you're looking at is essentially a DataGrid with the additional concept of a row renderer. I didn't actually call it that, but you can set the nestedChildFactory property to any item renderer that you want. When you click the disclosure arrow to expand a row, that renderer is drawn across the entire grid.

In the example, I'm drawing a PieChart and binding the data provider of the chart to the detail column of the data in the row being rendered. The effect is pretty cool: a pie chart nested inside of a DataGrid that shows/hides based on the disclosure state.

Here's a code snippet for defining the nested child:

<controls:AdvancedDataGrid
        id="advancedGrid"
        dataProvider="{dp}"
        width="100%"
        height="100%"
        sortableColumns="false"> 
        
        <!-- The component for the detail view -->
        <controls:nestedChildFactory>
            <mx:Component>
                <mx:VBox height="200" width="100%">
                    <mx:PieChart dataProvider="{data.detail}"
                        width="100%"
                        height="100%"
                        showDataTips="true">
                        <mx:series>
                            <mx:PieSeries labelPosition="callout" field="amount" 
                                labelFunction="outerDocument.displayLabel" />
                        </mx:series>
                    </mx:PieChart>    
                </mx:VBox>
            </mx:Component>
        </controls:nestedChildFactory>
        
    
        <!-- The columns for the master view -->
        <controls:columns>
            <mx:DataGridColumn dataField="name" headerText="Name" />
            <mx:DataGridColumn dataField="total" headerText="Total" />
        </controls:columns>
        
</controls:AdvancedDataGrid>

This approach offers a lot of flexibility. You can nest children until your heart is content (i.e. create an AdvancedDataGrid as a nested child of another AdvancdedDataGrid, and so on down the line). You can even do some fun things like create a TabNavigator inside of a DataGrid and offer advanced editing screens inside of the row that you're editing.

The component was inspired by The XtraGrid Suite for .NET. Everything you see in those screenshots should be possible in Flex now as well.

Unfortunately, this isn't something that I can release the source for. It was built specifically for a client of mine. However, a thread surfaced recently on FlexComponents about this type of component. Since I've been sitting on this code for awhile, I thought it was a good time for show and tell. I wanted to show that this type of effect is in fact possible and demonstrate just how extensible the Flex 2 framework is.

Alex Harui gives a good introduction for building a component like this on your own. I highly recommend the FlexComponents mailing list if you're interested in custom component development.



About this Archive

This page is an archive of entries from February 2007 listed from newest to oldest.

January 2007 is the previous archive.

March 2007 is the next archive.

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

Archives

OpenID accepted here Learn more about OpenID
Powered by Movable Type 5.02