Archive for August, 2007

Atmospheres – AIR Music Player

I’ve been a bit unhappy with the previous version of my music player. I didn’t really liked the way it looked and I really thought it could use playlists. I reused a number of classes from the earlier version, but switched things around and added more features. The new version, which I call Atmospheres, was written to illustrate some other concepts in Flex and AIR.

Some of the things you’ll find in this version are: Dynamically loading style sheets; switching renderers on the fly with a TileList; custom events; custom drag & drop; and more. A more complete list is given below.

You may not be able to run the AIR program as I’ve developed it with an internal beta version of Flex 3. If you have the public beta version of the AIR SDK, recompile the source code, make sure you compile the CSS files into SWFs, too.

If you aren’t interested in developing AIR applications there are still a number of Flex component topics that might be applicable to your work.

Atmospheres with Orange Neon Style
orangeneon_screen_large.jpg Orange Neon Style
Atmospheres with Adobe Red Style
adobered_screen_large.jpg Adobe Red Style

Continue reading…

Adobe Extends Web Leadership with H.264 Support

Check out our latest press release on Adobe.com:
http://www.adobe.com/aboutadobe/pressroom/pressreleases/200708/082107FlashPlayer.html
and find out how we’re incorporating HDTV support into the Flash Player.

There are also other improvements too, such as caching of Flex framework SWC, improved rendering on multi-core processors, and much more.

Did you know?

Some formatting options may not be so obvious. These work-arounds come from my teammate, Nick Watson, in the U.K. I thought I’d share them with you.

The CurrencyFormatter does not supply leading zeros to values less than 1. For example, when you format the value 0.45 you get $.45 and not $0.45. There is no options on the CurrencyFormatter to add or supress leading zeroes.

The work-around is to change the decimalSeparatorTo property of the CurrencyFormatter. Here’s a class which extends CurrencyFormatter and overrides the format function:

import mx.formatters.CurrencyFormatter;

public class LeadingZeroCurrencyFormatter extends CurrencyFormatter
{
public function LeadingZeroCurrencyFormatter()
{
super();
}
override public function format(value:Object):String
{
var n:Number = Number(value);
if( Math.abs(n) < 1 ) decimalSeparatorTo = "0.";
else decimalSeparatorTo = ".";

return super.format(value);
}

}

If you need to format Dates you might want to look at the DateBase class:

http://livedocs.adobe.com/flex/2/langref/mx/formatters/DateBase.html

First of all, if you need to know the names of the months or days of the week, you don’t have to code them yourself. DateBase.monthNamesLong is a static property and you can use the values in your application. Having all of the month names in one location makes it that much easier to change them.

Secondly, if you want to change the names to another language, simply replace this Array with new values:

DateBase.monthNamesShort =["Ene","Feb","Mar","Abr","May","Jun","Jul","MyMonth","Sep","Oct","Nov","Dic"];

Now any DateFormatter calls you make will use these new values for the short month names.

Flex Developer Center

On August 8 (I know, I’m late with this), the Adobe Flex Developer Center has new content:

Check it out!