« August 2006 | Main | November 2006 »

October 30, 2006

A good time waster for today: brightcove.com

Check out brightcove.com for lots of video goodness. The site was consumerized, and you can now view videos through a popularity ranking or microchannels. The Horror Channel is a good one for this week.

There's a lot more to today's launch, including the ability for anyone to launch a Brightcove channel, AdNet, website affiliates, distribution through AOL Video, open APIs, and lots more that you can read about in this article. There's also a barrage of press today.

It's been exciting starting at the company at this time (and quite lucky). It has, however, meant that I haven't gotten to meet everyone yet, as there's a lot of people who have been working around-the-clock to get this all out.

If anybody is wondering, I promise to get back to some technical posts on this blog. Next up will probably be a post about my current experiences with Flex.

Posted by Brian at 8:34 AM

October 24, 2006

Brightcove looking for Flex developers and QA

Brightcove is looking for developers and QA for an exciting, new Flex 2 project. This is the project that brought me to Brightcove, so you'll be working with me on creating an application that focuses on video on the Web.

We would love Flex experience, but if you're just starting down the path of Flex and want to keep learning more, we're definitely interested as well.

The positions are based in Cambridge, Massachusetts. To apply, please see the links below or send your resume to work AT brightcove DOT com.

Software Engineer: http://tbe.taleo.net/NA4/ats/careers/requisition.jsp?org=BRIGHTCOVE&cws=1&rid=116

Senior QA Software Engineer: http://tbe.taleo.net/NA4/ats/careers/requisition.jsp?org=BRIGHTCOVE&cws=1&rid=112

Posted by Brian at 12:05 PM

October 22, 2006

Pay media on Brightcove (but not with Flash)

I noticed that the lastest update to Brightcove's services includes a beta of pay media services for distrubuting your content to everyone for a price.

As I would have guessed, the pay services require the use of Windows Media Video. Hopefully in time Flash video will have a good, non-streaming solution to DRM. It is something that's often discussed and worked on.

Posted by Brian at 6:22 PM

ASDoc: a list of fixes and how to alter the output

Update: Flex now includes ASDoc. The documentation is here.

ASDoc, currently on Adobe Labs, will be included in the next update to Flex. I don't know the full list of ASDoc fixes, but I can share that the top three issues in the Labs build have been fixed:

  • UTF-8 characters show correctly
  • Bindable metadata doesn't affect output
  • No more circular inheritance errors when using doc-sources
I also wanted to share some information on altering the output. If there's a small bug in the output or it doesn't look quite right to you, there's something that can be done already to fix this. You can alter the the files in the templates directory, asdoc/templates. You should copy this directory to have different template files for different ASDoc builds. Point to a different template directory with templates-path.

The templates directory contains HTML files which can be edited to alter the look of the final HTML files. There are also XSL files in there for the adventurous. It's not a supported feature to alter these files, and they will certainly change in future releases, but they are helpful in getting the final output to look just right.

Posted by Brian at 5:53 PM

October 21, 2006

Category Feeds and Other Updates

This blog went through an overhaul* today, with a new look and new feeds. If you only want to read about Flex now, you can use this feed:
RSS 2.0 (Flex category only)
If you're coming here for video and Brightcove information, then use this feed:
RSS 2.0 (video category only)
And all of the posts are still available on this feed:
RSS 2.0

Also, unrelatedly, I've been asked by a few people if I'll be at MAX this year. I won't be there, as I'll be diving into the new job. I'll just have to drink with everyone another day.

* I updated Movable Type to 3.3, which was surprisingly painless. The snazzy new CSS styling is from Lilia Ahner. The category feeds were figured out from Anders Jacobsen's blog.

Posted by Brian at 5:12 PM

October 12, 2006

Heading to Brightcove

I'm leaving the house of Adobe and heading out to sea. I've decided to join Brightcove, where I will be working on a Flex application and helping the push towards Internet TV.

It was not an easy decision- I've worked with many great people during my six year stint in the Boston office, and Adobe is an excellent company to work for. But I've gotten very excited about the job at Brightcove and what the company is doing.

I plan to still stay involved with Flex at some level, as I think it has a very promising future. This blog will now talk about Flex as well as Internet video. Separate RSS feeds will be set up soon.

To end with, here's part of the email I sent out to the people I work with:

It was beer-o-clock on Friday that I finally realized that I'll soon be leaving here for good. More than six years ago I came here, and I couldn't believe that I got to work on JRun, a product I was already using. We put out a few releases, decided dung beetles weren't a good idea for an advertisement, and then scattered. I ended up on ColdFusion, where Damon put Erik and me to work on eeking out performance improvements, and where I got to give a code name to a product (RedSky). From there it was on to Royale, where I saw many parts of Flex. I went from RemoteObject advice from some Scottish voices to arguing web services with Tom Ruggles to SWCs and Flex Compiler Core.

I would mention all the people who stick in my mind over the years here, but that would take up all the time I need to still finish my last feature... but I do want to say thanks to everyone. I very much appreciate all the friends (and products) that have been created in my time here.

Posted by Brian at 5:08 PM

October 6, 2006

Using Resource Bundles in Flex

An important note: if you're planning to use this information for Flex 3 development, please see the documentation instead. There's a number of significant differences in using resource bundles in Flex 3. This information is only applicable to Flex 2.

This 1100-word article was supposed to be published, but I haven't heard anything about it in a long time. So I'm sharing it here:

There comes a day when we all need an application in multiple languages. In Flex, the solution to this problem is resource bundles. In this article, I'll describe the basic use of resource bundles and create a small example in Flex Builder. I'll also suggest some resources for further exploration and ponder some potential future directions of this feature.

The Basics of Resource Bundles

A resource bundle is a simple file, commonly called a properties file, where keys and values are stored. The file format for resource bundles is similar to Java properties files, with a "key=value" on each line. The main difference from the Java properties format is that files with non-ASCII characters in them should be stored as UTF-8.

Properties files are put in directories where they can be searched for by the compiler in the same way that other source files are found. The properties files should be arranged in directories in a specific way that's explained in the example below.

The values in the resource bundles can be accessed in Flex through @Resource in MXML or through ResourceBundle metadata and the ResourceBundle class in ActionScript. There's two pieces of information that are needed to access resource bundles in MXML or ActionScript- a bundle name and a key. The bundle name is the same name as the properties file. So if you create HelloWorldBundle.properties, the bundle name is HelloWorldBundle. The keys are found in the properties file, to the left of the values.


Setting Up the Flex Builder Project

We'll start off the example by creating a new Flex project in Flex Builder. When creating the project, select Basic for data access and name the project whatever you'd like. Click on "Next" to enter more information.

Before entering anything else in Flex Builder, we need to create directories for the properties files. The files should go in their own directories that are outside of any current source path. I've created the main directory for the properties file in the default directory for projects:

	   C:\Documents and Settings\bdeitte\My Documents\Flex Builder 2\locale

We also need to add subdirectories for each language we plan to have resource bundles in. The subdirectory names should match the locale names we plan to use We'll be using en_US for our English strings and sp for Spanish strings. So now I have:

	  C:\Documents and Settings\bdeitte\My Documents\Flex Builder 2\locale\en_US
	  C:\Documents and Settings\bdeitte\My Documents\Flex Builder 2\locale\sp

We'll get back to putting files in these directories later. Now we want to finish setting up our Flex Builder project. To have the project find the resource bundles, we need to add the directories we've just created to the source path. We don't add a source path for both en_US and sp, but rather we use the special "{locale}" signifier. So I add this folder as a source path in Flex Builder:

	  C:\Documents and Settings\bdeitte\My Documents\Flex Builder 2\locale\{locale}

The Main application file name should be changed to HelloWorld.mxml. Then click Finish.

Creating HelloWorld.mxml

You should now have a HelloWorld.mxml file in front of you in Flex Builder. In Source mode, change HelloWorld.mxml to the following:<.p>

	<?xml version="1.0" encoding="utf-8"?>
	<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
		<mx:Label text="@Resource(key='hello', bundle='HelloWorldBundle')"/>
	</mx:Application>

This is all of the MXML for the Hello World application that we are building. Note the use of @Resource for the Label's text and the key and bundle information. At this point you can try to compile HelloWorld.mxml, but you'll get the following error:

   Unable to resolve a class for ResourceBundle: HelloWorldBundle.	

A class is mentioned here because the Flex compiler thinks of the properties files as classes, and it can't find a properties files.

Adding the Properties Files

Create the file HelloWorldBundle.properties in the en_US directory created earlier. Add the following to the file:

	   hello=Hello World

Create HelloWorldBundle.properties in the sp directory, and add the following to the file:

	   hello=Hola Mundo

The names of the properties files correspond to the bundle value we specified in @Resource, and the key value corresponds to the left side. We could add more key values as needed, like this:

	hello=Hola Mundo
	one=uno
	bye=Adios
Building and Running the SWFs

We can then go back to Flex Builder and run HelloWorld. When you run the project, you should see on the screen the most exciting of Flex applications, "Hello World".

To run the project in Spanish, right-click on the project name and bring up the properties for the project. In the additional compiler arguments, change the locale from "en_US" to "sp". The "sp" matches the folder name where we put the second HelloWorldBundle.properties. When you run the project after this, you will see "Hola Mundo".

If you were building these Flex applications for later use, you would have to copy the directory of output files from the English version before building the Spanish version. Alternatively, you could build these files with the command-line compiler when creating the final SWFs. You would also need to build a page in HTML or Flash for choosing between the different languages.

Further Exploration

We only explored using @Resource within MXML and did not use the ResourceBundle metadata in ActionScript. This is an essential part of using resource bundles. Check the "Localizing Flex Applications" section of "Flex 2 Developer's Guide" in the Flex documentation to learn more about this.

We didn't discuss a few of the more advanced features of resource bundles in this article:

  • Resource bundles can be used inside of SWCs if you create resource bundle SWCs.
  • Complete classes and media such as images can be internationalized by using custom resource bundles.
  • All of the framework uses properties files, and by using the framework source you can localize the framework.

More information about these features can also be found in the "Localizing Flex Applications" documentation.

The ResourceBundle API documentation can be used to learn more about resource bundles, but try to ignore the main summary on the page. Significant pieces of the description are currently incorrect.


Future Directions

There's a few issues with resource bundles which will be fixed in the next update to Flex. Most notably, Flex Builder can show an error after updating a properties file. You'll know you are encountering this problem if you see an "Unable to resolve a class for ResourceBundle" error where the class mentioned ends with "_properties". Clean the project in order to remove the error.

We haven't decided on this change, but Flex Builder could remove the need to copy directories. This could be done through a publish dialogue that allows multiple locales to be chosen.

Flex could allow resources to be dynamically retrieved at runtime. For now, Flex only supports the compiling of resource bundles into the SWF.

In the far future, Flex may allow different translation formats than properties files, such as the XML Localization Interchange File Format. We also plan to allow media and classes to be added to properties files. This will mean that custom resource bundles won't be needed for complex resource bundles.

Update: As noted in the comments, this article was published.

Update2: This article has been translated to Chinese on zhuoqun.net.

Posted by Brian at 1:17 PM