If you don’t know the term, a tyre kicker is the kind of self styled “expert” who comes round to see the car you’ve got for sale and bores you senseless by talking rubbish (and will invariably kick it’s tyres at some point when doing so). They are in almost all cases almost entirely ignorant and very opinionated of the subject they are talking about, and are only wasting your time.
Which is a little bit like how I feel about writing anything about flex4/Gumbo, but I’ll try to get over that and make an effort to not be too ignorant, opinionated or boring …
Well, I’ve got very excited about the new text engine in flash 10, and even more so about what might transpire in flex 4. I’ve always struggled with the text in flash, and trying to manage clients expectations about what it can do and how hard it will be (Sadly, in most cases so far, not much, and very).
So if you want the get the skinny on what the lovely people at adobe are proposing, check out
Gumbo TextArea – (Mini) Functional and Design Specification ,
Gumbo Text Primitives (TextBox, TextGraphic, and TextView) – Functional and Design Specification
and also flash.text , flash.text.engine , and text.model in the Gumbo asDocs.
From what I can tell, it’s looking pretty comprehensive and well thought out.
So how do you get to play with all this new typographical goodness I hear you ask?
Well, you’ll need to download and install (in my case in flexbuilder 3) a build of the Gumbo SDK, I followed the (as usual) excellent instructions at flexexamples.com
Now, once done I found a flexbuilder project using last fridays SDK build to be, well, a bit flakey!
Code completion, formatting and colouration was all over the place, design view doesn’t work and imports need to be typed manually, plus a few other oddities and occasional blow ups.
This is entirely as I expected, this code is not even alpha and actually I’m quite pleased it works as well as it does. I’m very happy that we are allowed to play with it as it stands and get a feel for what’s coming rather than having to wait for a milestone (alpha) build, so from my point of view it’s all good.
In an attempt at “tyre kicking” I’ve knocked up an awfully simple “not particularly rich at all” text editor, a link to which you’ll find at the end of this post.
What had particularly caught my eye was the ability to populate a TextView from text or xml, and a built in method ( export() ) that should export an xml object that can be saved / used as the content for another TextView. In other words, we have the basic building block for a proper rich text editor in flex, and a markup language for the same.
In practice, when I tried this, it blew up! Never mind, I’m pretty sure that adobe engineers just have not got far with it yet (either that or I did something wildly wrong in my ignorance). The raw export gives an xml object with a “TextFlow” root node and “flow” namespace, but poking that back into the TextView source just errors out. I did find, however, that removing the root node and the namespace gave xml markup that largely worked, so I’ve added a “filter” function in my text editor that does just that, for the moment.
Unchecking the checkbox for that shows you the unfiltered export() output.
I also noticed that:
I could get a div tag to work in mxml markup, but not by setting the content as a string.
On occasion I’d set content that made the TextView unresponsive to further changes.
Spaces can get removed. This may be a configurable setting that I’ve not discovered as yet.
So far, I’ve not really got into exactly what markup you can use, but my “editor” should at least provide a way to experiment. I’m considering adding a “gallery” function for people to save and submit their own markup examples, if you’d like to see that then drop me a comment…
It should allow you to enter markup code in the top textarea, set it as content in the middle (Gumbo) textarea, and export the Gumbo textAreas contents to the bottom textArea for inspection/copying.
There are also some very simple controls for editing properties of selected text in the gumbo textArea.
I’ve included the source (didn’t seem to work in flexbuilder for this project, so click the source link instead) so you can take my rather meagre beginnings as a start for your own experiments (or to laugh at, as you see fit).
I’ve not taken it very far at all, I think it’s probably a little bit early for that given that gumbo is still in the early days, so please forgive me for that.
I hope it is of some interest though, and encourages your own investigations, experimentation and improvements (which I look forward to seeing). If you have any, then please do drop a comment with a link so that people can easily find it if they end up reading this post.
view example
(yes, it requires flash player 10)