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 October 3, 2009 10:25 PM
|1 Comment
Hi everyone,
Today we shipped public beta 2 of Flex 4 and Flash Builder 4 on Adobe Labs. Even though it's kind of been a moving target, we have a pretty full set of learning resources and I'd like to take a minute to lay them out for you.
As before, you should start by reading the introductions from our Product Managers:
Also, if you are a Flex 3 customer, you should read Joan Lafferty's Differences between Flex 3 SDK and Flex 4 SDK beta article, which (as of today) has more information than the Features and Migration guide.
Although we still have a lot of work to do, we've provided a fairly rich set of beta documentation.
Using Adobe Flex 4(PDF) - Flex SDK and Framework usage content. This book combines the Flex Developer's Guide, Creating and Extending Flex Components, and Building and Deploying Flex Applications.
Adobe Flex 4 Tutorials(PDF) - Tutorials to help you get started with new Flex 4 and Flash Builder 4 features.
Accessing Data with Flex(PDF)- Usage content for data access in Flex. Includes information on new Flash Builder data service features. (Formerly Creating Data-Driven Applications with Adobe Flex 4.)
Adobe Community Help beta on Adobe Labs - A preview of Adobe's next-generation help experience. This beta release is configured to work with Flash Builder and Flash Catalyst content. I strongly encourage you to try this out.
And, as always, I need to acknowledge and thank the Flex Learning Resources team: Erich Champion, Janice Campbell, Linda Adler, Matt Horn, Pam Araki, Shimi Rahim, Stephen Gilson, and Vince Genovese. I also need to thank Akshay Madan, Mark Nichoson, Laura Kersell, Helen Whelan, and Tanya Knoop for all the work they put into the Adobe Community Help client and the Labs Beta release.