April 03, 2006

Layering Flex over AJAX and collaborating with data services -- whoa!

Christophe just posted an example of how to layer Flex over AJAX to do video chat and shared whiteboard as an overlay to Google Maps. You could use this to draw a route on a map for someone else to see, for example.

I think my head is going to explode.

http://coenraets.com/viewarticle.jsp?articleId=100

Posted by sho at 09:11 AM | Comments (0) | TrackBack

March 08, 2006

Some personal thoughts on the Flex/AJAX Bridge...

Before moving to the Flex project, I ran engineering for the HTML tools division at Macromedia. Back then, we thought a lot about advanced DHTML techniques, including the technique of using XMLHTTPRequest to update portions of a page locally, which has since come to be called AJAX.

As you can see from my posts, I eventually ended up moving to Flex. AJAX is wonderful and has its share of strengths, but I find working with Flex to be more fun for me personally. Flex is a great way to put together richer and more complex front ends. It has a runtime that is consistent across browsers, and an object model that is designed from the ground up to support networked application UIs.

I'm still a big fan of AJAX. I believed in it way back when, and I believe in it now. But Flex can do a lot that would be difficult in AJAX, both visually and in terms of data connectivity.

I'm quite curious to see how people use the two together. I'm convinced that some of the raw building blocks inside of Flash/Flex (e.g., binary sockets) have a lot to add to the AJAX puzzle.

P.S. In my last post, I mistakenly called this the Flex/ActionScript Bridge, which is obviously much less interesting. :-) Thanks to Robert Penner for pointning this out to me.

Posted by sho at 01:05 PM | Comments (9) | TrackBack

FAB - Flex / AJAX bridge

FAB - Flex/AJAX Bridge - is a library created by Ely Greenfield, who is a good friend and Flex Architect.

FAB lets you control Flex applications using JavaScript. Method calls just work, and getters and setters are converted to method calls (because browsers don't support getters and setters yet).

You can even attach event listeners from JavaScript and pass function objects back and forth. For example, you can create an MXML file with a button in it and drive all of the logic from within your HTML/JavaScript.

MXML:
--
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml">
    <fab:FABridge xmlns:fab="bridge.*" />
    <mx:Button id="okButton" label="OK" />
</mx:Application>

JavaScript:
--
function init()
{
    var flexApp = FABridge.flash.root();
    flexApp.okButton().addEventListener("click", handleClick);
}

function handleClick(event)
{
    // handle the click event here.
}


You can read more about it on Ely's blog, which I predict will be worth reading.

http://www.quietlyscheming.com/blog/2006/03/06/flex-and-ajax/

Posted by sho at 09:07 AM | Comments (3) | TrackBack

February 15, 2006

MXML text completion control v. 0.5 (aka down with combo boxes!)

I've always been frustrated by the way HTML applications use pull down menus. How many times have you had to pick a country out of a huge pull down menu? Do you use the mouse to scroll down to the country? What about using the keyboard? You have to keep hitting the same key over and over. Neither approach is easy.

Meanwhile, text fields that offer completion hints are starting to become standard for Flex and AJAX applications. Typicaly, these are used to let you quickly pick things that you've already typed into the box. They are not used for picking, say, a country from a list of countries.

I believe text input fields that offer hints for possible completions should be used instead of combo boxes 95% of the time. Down with combo boxes!

1) When you want to use the mouse, it is just as simple.
2) When you want to use the keyboard, it gives you better feedback on what you have typed already.
3) It gives you an obvious affordance to "start over" when you've made a typo.
4) It gives you more immediate feedback.

Here is a relatively simple version of a text completion control for MXML. Unlike most versions of this type of control, this is also optimized for the above case: picking from a list of predefined strings.

Run sample

When you want to pick from a list of predefined strings, just supply the list of all strings as the dataProvider of the control (just like how ComboBox works), and set the "mustPick" flag to true.

Let me know what you think. Are there bugs? Do you think the heuristics are wrong? Is this a good idea in general?

P.S. I've also had to include some other random classes as part of this. I plan on officially distributing these classes and other classes once they are more baked.

Posted by sho at 08:25 PM | Comments (11) | TrackBack