Looking for Work

english mobile

So far, most of the Flex work I've done has been Flex applications embedded in Authorware applications. My current Authorware and Flex project is winding down, and I'm looking for a purely Flex project to work on next. If you have benefitted from this blog and you know of a Flex job, especially a telecommuting job, please either contact me or pass on my information to whoever's hiring.

Thanks! :-)

TileList with styleFunction

english mobile

Recently I had a requirement to have buttons displayed in a grid with different color backgrounds based on the underlying data. Thus, the TileList_withStyle was born. The TileList_withStyle is simply a TileList extended to have a styleFunction. Note that I mostly just copied and modified the styleFunction code from the AdvancedDataGrid control. You can probably use the same technique to add a style function to pretty much any List-based control.

At the same time, I also needed to set the icon on the button based on the iconFunction that TileList already had. Unfortunately, the Button class does not have hte inherent capability to use the icon as it is passed in through the iconFunction. Thus, the IconFunctionableButton was born. I've posted an example file demo-ing these two classes. Right-click and select View Source to get the source code.

Charting Example

english mobile

A couple of weeks ago, I said I'd compile some thoughts about charting. Normally, this would mean that I'd talk about charts in a general way. I'm not much on posting code, mainly because I'm terrified that I'll post something that will lead someone who's even more newbie than I am down the wrong path. Instead, I prefer to talk about code in general terms, then let people go off and make whatever mistakes I've inspired them to while I keep a clean conscience.

But this week someone asked me to give an example of showing how to add an axis in ActionScript, so I thought I'd do that just this once because my husband just had shoulder surgery and goes to bed early these days. While I was at it, I threw in a little bit of this and that other stuff I'd learned while building charts.

I don't claim my approach is the only approach or the best approach to the problem. But here's an example of how to create a chart entirely in ActionScript. Right click to view source. If you pick up bad habits from it don't blame me!!!

Resources for Learning Flex

english mobile

I started this blog to document the hurdles I was finding as I was learning Flex 3. In the year since I started blogging on Flex, this task has become much easier. I wanted to take a minute to talk about two things that I've noticed that are real improvements. First, the Start Page appears to update itself occasionally.

I've posted before that I had problems learning to use the debugger due to lack of resources that explain its basic functionality. A few weeks ago, I cranked up the Start Page for some other reason and noticed it had scroll bars. I scrolled down, and lo and behold! there was a link to a video tutorial on the debugger!

The second, I noticed just today when I was looking at the web version of the Flex Builder forums (I usually use NNTP). I noticed there's a forum for Flex in a Week, and since I'm nosey I opened it up and discovered a link to the Flex in a Week training course. I haven't had a chance to look at all the resources, but the topics look like they should be useful to the new learner of Flex. Thanks to the folks at Adobe for being proactive and helping new users over the learning curve hump!

Some thoughts on charting

english mobile

This past week, I made my first foray into the world of Flex charting, and I'll have to say that I found it a pleasant surprise. From all the comments I've seen from others using charting, I had expected a difficult, painful process. My experience was quite the opposite. This is the first time in my year or so of using Flex that I've been able to accomplish anything significant without having to customize or rewrite anything. It seems that almost anything you'd want to do with a chart, there was a property or style that would handle it. I did find the fact that nearly everything was a style a bit confusing at first, but once you realize this, it goes fairly smoothly.

I might not have found the whole experience quite so smooth if I hadn't found some nice examples by good people who were willing to post their code for the world, so I thought I'd acknowledge them here:

I learned a lot about charting this week, and I hope to have time someday to share more of it, but I did find two quick things that might be helpful to you if you're trying to get your charts looking exactly right. The first is if you use a line chart with itemRenderers that mark each data point in the chart, the first and last one will be cut off through the middle where the chart control clips the content. The solution is to set clipContent on the chart to false. Seems obvious, but took me two days to find it.

The second is that if your first legend item in a Legend control has a short label, you'll wind up with overlapping legends where the Legend control lays them all out as if they had a short label. You can use the markerWidth style to make all of the legend items the same size, and you can just make sure that size is large enough that your legends don't collide. No, this won't give you a pixel-perfect layout, but it is a heck of a lot quicker than fixing either Legend or LegendItem to correct this.

Getting Help in Flex Builder

english mobile

When I open the Help Contents in Flex Builder 3, the first thing on the page is Tip! Learn how to filter and reduce your search results by reading "Searching Help." The problem is that on my installation of FB3, this is a dead link. I checked it this week on my husband's installation, and his link is dead as well. I eventually figured out what this page would have told me, but I feel like I was really slowed down in those early months when I had no control over the search results that would flood the results page when I searched for anything. A couple of weeks ago, I found the Flex 2 version of the page, when I no longer needed it.



But I thought I'd share a bit about how my help contexts are set up, because I find that these really cut the amount of time I need to mine relevant information. I have two main contexts that I use most of the time. The first is "How to." This gives me access to the "how to" instructions on most of the topics that I would be working on. I have unchecked AIR for now, since I'm not working in AIR these days.

My second help context is just the Language reference. I find that my pattern is to read the how to for a general overview of how to approach a problem, then I switch to the language reference context for the specific details (like property values and what they do). Sometimes I use the "Find in Language Reference" option on the Help Menu, but I don't like it as well, because it resets my help context.

It seems to me that there are certain search terms that are very difficult to get to in the Language Reference context, because they are inherited by many components. Since the name of the component that is being inherited from occurs early in the documentation for it, it will often appear in the search results before the results for the component itself. So I've learned that there are a few ways around this. If I am searching for List, I type in ListBase. List will actually come up in the search results ahead of ListBase. If I am looking for UIComponent, I click on the first thing that inherits from it and use the link in the "inheritance crumb trail" to go to it. If I am looking for AdvancedDataGridItemRenderer or AdvancedDataGridGroupItemRenderer, I look for AdvancedDataGrid and click the advancedDataGridClasses Summary. This gives the advantage of allowing me to easily get from one class to another.

In the next few weeks, I'm going to try to post a few Tips and Tricks about how I use Flex Builder itself to be as productive as possible, independent of any code I might be using. I'd like to invite you, the readers, to consider these posts to be an invitation to discuss their own tips and tricks by posting comments. Hopefully, we can all trade our best productivity tricks and become more productive together.

Debugging itemRenderers

english mobile

You may have notced that I have spent a lot of time chasing down issues with itemRenderers. It always frustrated me that you could get information on the parent of any component, but I could never figure out how to find out information on the renderers being displayed by a List based control.

I finally realized that if I set a break point in a scope that had a reference to a List control, I could rifle through the properties of that control until I found the rendererArray property, which seems to be an array of arrays. If you're not using a multi-column control, like a DataGrid or an AdvancedDataGrid, the itemRenderer for each row will be at the 0 index of each row index. Otherwise, each row will be the outer index of the rendererArray and each column will be an element in the row array.

I really do view this as my diary of Flex, and I got tired of not ever remembering what the name of the property is. It can take quite a while to fish through all the properties available on a control to try to relocate it. So I wrote it down, since it doesn't seem to be documented. Hope it helps you, too :-).