Monthly Archives: July 2007

Displaying XML data in a DataGrid

OK, hopefully this example is a bit more interesting than a few of my previous ones. Today’s handy tip comes in the form of loading and embedding an XML file in our Flex application at compile-time (as opposed to dynamically loading at run-time, which we’ll save for a future example), and displaying that information in a DataGrid control.

Continue reading Displaying XML data in a DataGrid

Filing bugs in the Flex public bugbase

So by now you’ve undoubtedly played around with either Flex 2.0.1, or the Flex 3 beta and you may or may not have encountered what you suspect is a bug. What next? Well, enter the public bugbase, JIRA. You can find the public Adobe Flex Builder and Flex SDK bugbase over at http://bugs.adobe.com/flex/, and you’re greeted with a few different options:

  • Search (Browse without registration) — Pretty much just what it says. Allows you to search the public bugbase for bugs without logging in or registering for an account. Searching is always recommended before filing any new bugs as it reduces the amount of duplicate bugs, and you may find that your particular bug has been fixed in a newer build of the SDK. Although you have a couple options, this view is somewhat limiting since you can really only view the bugbase (you need to register and log in to submit bugs) as well as browse certain projects to see fancy charts and graphs of where the reported bugs are versus each component/release version/who the bugs are assigned to/whether a bug is open or closed/a breakdown of bugs by priority/bugs by assignee/etc.
  • Login –If you have registered already, click here to log in to the Flex Bug and Issue Management System. If you haven’t registered, click the following link “Register / Create new account”. Note that you must be logged in to log bugs in the public bugbase. If you’ve signed up in the past but forgot your password there is a “Forgot Password” link on the login page that will let you enter your username and have a new password mailed to you. Forgot your username? Well, we got you covered as the Forgot Password page has a link to the “Forgot Username” page which lets you type in your email address and have your username emailed to you.
  • Register / Create new account — If you haven’t yet registered for an account in the public bugbase system, this is the place to go. Registration is simple and only consists of a few, easy to answer, form fields. Just type in your desired username/password (and confirm it)/full name/email address (in case you want to subscribe to bugs or wish to ever retrieve your username/password in the future — we won’t spam you)/and finally just type in the word you see in the capcha at the bottom of the page. That’s it! Six fields and you’re on your way to public bugbase goodness.
  • Bug Standards / Community process –Click here to see all sorts of useful notes and instructions for getting involved in the community, creating new accounts, browsing existing bugs, voting on existing bugs, reporting new bugs, tips on writing good bugs (Tip: always include source code with steps in how to recreate the behavior — upload SWFs and screenshots as well), how to submit source code, and finally a list of frequently asked questions (the FAQ, if you will).

It is also very important to note that the bugbase isn’t just for filing bugs. This is the main place to file any enhancement requests and other things as well. And the coolest part of the system is that Adobe uses the exact same system. No more separate bugbases for internal and external users. Continue reading Filing bugs in the Flex public bugbase

Changing the default button labels on an Alert control

When I first started playing with the Alert control, this tripped me up for a couple minutes. When trying to override the default text on the Alert control’s buttons, you need to set the Alert.cancelLabel, Alert.noLabel, Alert.okLabel, and/or Alert.yesLabel static properties *before* calling the Alert.show(). Sure, sounds a bit obvious in hindsight, but it is also important to remember that since those values are static, they apply to all Alerts, not just the one specific Alert. So you may have to reset the values back to their defaults once the Alert has been displayed.

Continue reading Changing the default button labels on an Alert control

Formatting colors as strings with ActionScript

Here’s a pretty weak tip, but maybe somebody out there will find it useful. Often when working with colors, you need to format the text before displaying it, otherwise blue may display as “ff” and black as “0”. Here’s a semi-handy tip for making sure numbers display as hex values with at least six characters (and all uppercase, no less).

Continue reading Formatting colors as strings with ActionScript

Toggling a DataGrid control’s horizontal grid lines and vertical grid lines

OK, this is a pretty neat trick. Flex makes it pretty easy to customize the look and feel of the DataGrid. For example, the following code lets you toggle the data grid’s horizontalGridLines and verticalGridLines styles on or off, change the alternating row background colors so each row is a plain white, and sets the horizontalGridLineColor and verticalGridLineColor styles to red.

Full code after the jump.

Continue reading Toggling a DataGrid control’s horizontal grid lines and vertical grid lines

Setting the amount of time that a tool tip is visible using the ToolTipManager class

Ever wonder how to control the amount of time that a tool tip stays visible before disappearing? Well, wonder no more! You can control the length of time that a tool tip remains visible from the default 10 seconds to whatever you want by setting the ToolTipManager.hideDelay property. Simply set the value to however many milliseconds you want the tool tip to be visible for before disappearing and you’re set.

Full code after the jump.

Continue reading Setting the amount of time that a tool tip is visible using the ToolTipManager class

Creating multi-line data grid rows with variable row heights

One of my favorite Flex components is the the trusty DataGrid. It seems whenever I build some sort of application or sample, I need a DataGrid to show all sorts of debug data or what have you. Here is a simple little example of a DataGrid with multi-line content and a variable row height.

Full code after the jump.

Continue reading Creating multi-line data grid rows with variable row heights