Friday, February 26, 2010

How to setup a Sandbox for Flex 4 SDKs

1) Unzip the SDKs, as you download them,into the recommended directory structure shown here:

2) In Flash Builder 4, add the SDK by goign to: Window > Preferences > Flash Builder > Installed Flex SDKs. Don't make it the default if you want the older stuff to still function.

3) Create you sandbox project and be sure to specifically select the newly added SDK, rather than the default.

3) Add this compiler option in your project settings (right-click on
your project-->properties-->Flex Compiler-->under additional compiler

4) You may also need to make the following modification in Flash Builder: Project->Properties->Build Path->Library Path->Framework Linkage and select 'Merged into code'.

5) Also one very important action which you must perform as pointed out here:
1) Rename the folder /frameworks/libs/player/10.0 to "10"
2) Edit the file /frameworks/flex-config.xml and remove ".{targetPlayerMinorVersion}" and save

6) If you still have problems, here are some references that might help you:
Reference A
Reference B

Thursday, February 18, 2010

Solr & Flex 4: Can it be done?

Is it possible to use Solr with Flex 4 as the underlying search engine for any product being developed? What are the merits of combining these two technologies? Can Solr provide hit highlighting when coupled with Flex? If so, then how? Stay tuned...

Wednesday, February 17, 2010

Adding flexibility to a Framework

We can often extend classes from Frameworks like Flex and Java but about plugging into the Framework in a more dynamic manner? How about taking control of a framework class in a manner that the overridden functionality will be used by anything in the framework that uses the existing class as well?

class Putty {
Putty flexible = null; // possibly improved implementation

frameworkMethod() {
if (flexible != null) flexible.frameworkMethod();

There is nothing ingenious about this other than the fact that IF it was adopted by Frameworks like Flex, it would allow for very powerful changes.

Tuesday, February 16, 2010

ToolTips: What could Flex 4 do better?

In UI there has been a long standing problem around what to do when some text doesn't fit a given area. The 1st reaction is to wrap the text. If it still doesn't fit, the 2nd reaction is to place a truncation indicator like "long label ..." and the 3rd reaction is to ask for a tooltip for the truncated text.

Flex 4 provides a semi-useful class Textbase to address this.

I use the word semi-useful because Flex 4 got the "when to show the tooltip" logic semi-wrong in my opinion. The tooltip shows up anytime the text has to wrap ... whereas it should really show up when the text actually gets truncated.

What is the point of a tooltip when the wrapped text happens to fit just fine within the provided area, without getting truncated? If you say maxDisplayedLines="2" and then you have:

label1 [no tooltip]

label2 which [shows tooltip]

label3 which [shows tooltip]
wraps and...

It feels very confusing as to why label2 has a tooltip and label1 does not. Unless you read this blog or figure it out for yourself you may even think that the tooltip behaviour is a bit inconsistent. So I think there's some room for improvement here.

Thursday, February 11, 2010

Flex 3 (Halo) Item Renderers in a Flex 4 (Spark) World

Why would anyone mix Flex 3 Item Renderers w/ Flex 4?

There isn't an out-of-the-box equivalent for the DataGrid component available in Spark. You may want a particular cell of your DataGrid to be rendered in a custom fashion. You may try to use a Spark Item Renderer which implements mx.controls.listClasses.IListItemRenderer but that will only render the initial list properly. When you try to scroll it at runtime will give you Error #1010: A term is undefined and has no properties. So you will need to use Halo Item Renderer.

But wait, where is the Halo equivalent for an Item Renderer in the Gumbo API?
Its called mx.controls.listClasses.ListItemRenderer, but it can't act as a container so there are inherent limitations to how much you can do with it.