By Matthew J. Horn on October 29, 2009 3:26 PM
|No Comments
I just recently discovered that there are several undocumented commands for fcsh, the command line compiler shell.
If you don't know what fcsh is... it's a simple shell environment for compiling Flex apps and libraries from the command line. Basically, it speeds up the compilation significantly. You can read more about it here:
The undocumented commands (and by "undocumented", I mean they aren't in the help system's doc on fcsh or listed in the fcsh online "help" command output) are:
cp (copy)
mv (move)
touch (change timestamp)
rm (delete/remove)
The syntax is pretty straightforward, but if you want to spend a few minutes documenting them, we'll happily add a link to your blog or web site from the Adobe help.
By Matthew J. Horn on October 8, 2009 1:23 PM
|No Comments
Working with text in Flex 3 can be difficult. Especially if you want to scale text to fit an area (a task I recently discovered was not intuitive at all). Should you scale the text control? Convert the contents to a bitmap and resize it? Set the fontSize and test it's width against the parent container?
The cleanest solution I found was to use was to compare the textWidth property of the Label against the parent container's width (the available area), and then scale the Label component based on that comparison.
Here's the running example (the default font size is 36 pts, but you can see that the second and third labels are scaled according to how much text is in the Label):
There's a bit of a caveat to this, which is that in general, this will not be a "UI best practice". A list of text items, where the text varies in size for each item in the list, is not the most readable or user friendly way to present information.
The main app and custom component files are below, but here's a few lines to show you how it's done.
In the Label tag, trigger a function on the creationComplete event:
You should also set truncateToFit to false so that a Label whose text comes close to the edge does not get truncated.
The scaleLabelToFit() function calculates the ratio of the main component's width to the width of the Label's text (textWidth):
var ratio:Number = ((this.width - myImage.width) - 10) / myLabel.textWidth;
This line subtracts the width of the image and an additional 10 pixels to account for padding.
Then, if the ratio is less than 1, scale the text control. If the ratio were greater than 1, you would not want to scale the text up, so just ignore that case.
By Randy Nielsen on August 18, 2009 4:15 PM
|4 Comments
Today, the Flex SDK team pushed the 3.4 milestone build live and you can get it from the Flex 3 SDK Downloads page. Simultaneously, we pushed the Flex 3.4 Language Reference live, overwriting the 3.3 version.
If you happen to land on a language reference page for an old version, you can use the version pod to navigate to the correct version. The version pod displays towards the top right of each page and you can hide it by clicking the right arrow icon.
In the weeks to come, I hope to write a series of posts that cover the kinds of things our group is doing to improve the overall experience with Adobe learning content.
By Randy Nielsen on June 11, 2009 11:10 AM
|1 Comment
I want to tell you about Blueprint, which we released on Adobe Labs last week and just last night updated to include support for Mac, Windows, Flex Builder 3, and Flash Builder 4.
Blueprint is an innovative code-centric search application, initially delivered as an Eclipse plug-in. It is a custom search tool that searches only for code (for now, it searches just for MXML and ActionScript). So, for example, if you search for DataGrid, it returns a set of code examples that use the Flex DataGrid control. But what's really cool is that you can easily highlight, copy, and paste chunks of code right into your application, all without leaving Flex/Flash Builder.
By Vince Genovese on August 13, 2008 6:01 PM
|No Comments
New specifications for Gumbo, the next version of Flex, are now available. Go to the Gumbo page of the Flex Open Source site to read, and comment on, the plans for Gumbo.