" /> Peter deHaan: March 2008 Archives

« February 2008 | Main | April 2008 »

March 31, 2008

This Week's Top Posts (3/31)

Here is a list of some of the various blog posts from the Flex SDK and Flex Builder team's blogs that I've been reading over the past week:

March 27, 2008

Adobe launches Adobe Photoshop Express

In case you didn't see the news, but Adobe launched Photoshop Express today!

For more information, check out John Nack's blog entry, "Photoshop Express RIA arrives!" (and "A note about PS Express terms of use"), or Ted Patrick's blog entry, "PhotoShop Express on Flex 3".

Curious what other people are saying? Check out some of the following links:

March 24, 2008

This Week's Top Posts (3/24)

Here is a list of some of the various blog posts from the Flex SDK and Flex Builder team's blogs that I've been reading over the past week:

This Week in Flex Examples (3/23)

A day later than usual, but here is a list of posts I managed to whip up over the past week over on my Flex examples blog, blog.flexexamples.com:

March 17, 2008

This Week in Flex Examples (3/17)

I didn't have time to post this yesterday, but here is a quick update on all the new entries over at my other blog, Flex Examples, during the past 7 days:

No real trends this week, although there are a few entries on the ExternalInterface API and the Panel container.

This Week's Top Posts (3/17)

Last week I did a post, This Week's Top Posts (3/9), on some excellent blog entries by various people on the Adobe Flex teams.

This week there seems to be a bunch more really good articles:

March 9, 2008

This Week's Top Posts (3/9)

And now for something completely different...

Here are a bunch of the best [Flex-related] posts from around the Adobe water cooler over the past week (or so). Lots of really excellent posts, so if you have some time, check a few of them out.

Random:

Migrating from Flex 2 to Flex 3:

Reminder: If you're in NYC on April 18th, don't forget there will be a Flex Camp on Wall Street from 9am-5pm. Check it out!

This Two-Weeks in Flex Examples (3/9)

Time for another "semi-regular" update on my other blog, blog.flexexamples.com. Here are all the posts I've published in the past couple weeks:

March 7, 2008

Using embedded fonts with the Flash CS3 ComboBox control

The following example shows how you can use embedded fonts with a Flash CS3 ComboBox control's drop down menu.

Full code after the jump.

The following example requires a ComboBox control in your library as well as an embedded font in your library with a linkage identifier of "VerdanaEmbedded" and a normal font weight.

import fl.controls.ComboBox;
import fl.data.DataProvider;

var font:Font = new VerdanaEmbedded() as Font;
var tf:TextFormat = new TextFormat();
tf.font = font.fontName;

var arr:Array = new Array();
arr.push({label:"One"});
arr.push({label:"Two"});
arr.push({label:"Three"});
arr.push({label:"Four"});
arr.push({label:"Five"});
arr.push({label:"Six"});

var cb:ComboBox = new ComboBox();
cb.dropdown.setRendererStyle("embedFonts", true);
cb.dropdown.setRendererStyle("textFormat", tf);
cb.dataProvider = new DataProvider(arr);
cb.move(10, 10);
addChild(cb);

Update:

If you want to add anti-aliased text to the main ComboBox itself (and not just the dropdown menu), you can use the setStyle() method to set the embedFonts and textFormat styles on the textInput property, as seen in the following snippet:

var cb:ComboBox = new ComboBox();
cb.textField.setStyle("embedFonts", true);
cb.textField.setStyle("textFormat", tf);
cb.dropdown.setRendererStyle("embedFonts", true);
cb.dropdown.setRendererStyle("textFormat", tf);
cb.dataProvider = new DataProvider(arr);
cb.move(10, 10);
addChild(cb);

Listening for an FLV file's metadata using the VideoDisplay control in Flex (Flex 3 edition)

The following example shows how you can use the metadataReceived event (MetadataEvent.METADATA_RECEIVED constant) to detect when the VideoDisplay has parsed the metadata from an FLV file in Flex 3.

Full code after the jump.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white">

    <mx:Script>
        <![CDATA[
            import mx.events.MetadataEvent;
            import mx.utils.ObjectUtil;

            private function onMetaData(evt:MetadataEvent):void {
                textArea.text = ObjectUtil.toString(evt.info);
            }
        ]]>
    </mx:Script>

    <mx:VideoDisplay id="videoDisplay"
            source="http://www.helpexamples.com/flash/video/clouds.flv"
            metadataReceived="onMetaData(event);" />

    <mx:TextArea id="textArea"
            editable="false"
            width="100%"
            height="100%" />

</mx:Application>

For more information on the VideoDisplay control in Flex 2, see http://livedocs.adobe.com/flex/3/langref/mx/controls/VideoDisplay.html.

For an example of detecting the metadata in Flex 2, see "Listening for an FLV file's metadata using the VideoDisplay control in Flex (Flex 2 edition)". For an example of displaying an FLV in Flex using the NetConnection, NetStream, and Video classes, see "Displaying a video in Flex using the NetConnection, NetStream, and Video classes" (blog.flexexamples.com).

Listening for an FLV file's metadata using the VideoDisplay control in Flex (Flex 2 edition)

The following example shows how you can use the internal MetadataEvent.METADATA constant to detect when the VideoDisplay has parsed the metadata from an FLV file in Flex 2.

Full code after the jump.

Method 1: use MetadataEvent.mx_internal::METADATA constant:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white">

    <mx:Script>
        <![CDATA[
            import mx.events.MetadataEvent;
            import mx.utils.ObjectUtil;
            import mx.core.mx_internal;

            private function onMetaData(evt:MetadataEvent):void {
                textArea.text = ObjectUtil.toString(evt.info);
            }

            private function videoDisplay_initialize():void {
                videoDisplay.addEventListener(MetadataEvent.mx_internal::METADATA, onMetaData);
            }
        ]]>
    </mx:Script>

    <mx:VideoDisplay id="videoDisplay"
            source="http://www.helpexamples.com/flash/video/clouds.flv"
            initialize="videoDisplay_initialize();" />

    <mx:TextArea id="textArea"
            editable="false"
            width="100%"
            height="100%" />

</mx:Application>

Method 2: use MetadataEvent.METADATA constant with use namespace mx_internal:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white">

    <mx:Script>
        <![CDATA[
            import mx.events.MetadataEvent;
            import mx.utils.ObjectUtil;
            import mx.core.mx_internal;

            use namespace mx_internal;

            private function onMetaData(evt:MetadataEvent):void {
                textArea.text = ObjectUtil.toString(evt.info);
            }

            private function videoDisplay_initialize():void {
                videoDisplay.addEventListener(MetadataEvent.METADATA, onMetaData);
            }
        ]]>
    </mx:Script>

    <mx:VideoDisplay id="videoDisplay"
            source="http://www.helpexamples.com/flash/video/clouds.flv"
            initialize="videoDisplay_initialize();" />

    <mx:TextArea id="textArea"
            editable="false"
            width="100%"
            height="100%" />

</mx:Application>

Method 3: use "metadataReceived" event name directly:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white">

    <mx:Script>
        <![CDATA[
            import mx.events.MetadataEvent;
            import mx.utils.ObjectUtil;

            private function onMetaData(evt:MetadataEvent):void {
                textArea.text = ObjectUtil.toString(evt.info);
            }

            private function videoDisplay_initialize():void {
                videoDisplay.addEventListener("metadataReceived", onMetaData);
            }
        ]]>
    </mx:Script>

    <mx:VideoDisplay id="videoDisplay"
            source="http://www.helpexamples.com/flash/video/clouds.flv"
            initialize="videoDisplay_initialize();" />

    <mx:TextArea id="textArea"
            editable="false"
            width="100%"
            height="100%" />

</mx:Application>

A big thanks to Arthur for the heads up, and Jamie for the suggestion.

For more information on the VideoDisplay control in Flex 2, see http://livedocs.adobe.com/flex/201/langref/mx/controls/VideoDisplay.html.

Any other suggestions? Leave them in the comments!

March 1, 2008

Checking out the source code for the charting and AdvancedDataGrid controls in Flex 3

Here's another question I've seen come up a few times. "Q: Where can I find the source to the Flex Charting controls and/or the AdvancedDataGrid control?"

A: The charting controls and AdvancedDataGrid controls are only available within the Flex 3 Professional edition. In order to view the source code for these classes, you need to input your Flex 3 serial number, and then you should be able to find the source code in the following folder:
C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\fbpro\projects\datavisualization\src\

Happy Flexing!

Installing the Flex Skin Design Extensions and Flex Component Kit for Flash CS3

I've seen a few people ask this question lately, "Q: Where can I find the latest version of the Flex Component Kit for Flash CS3?".

A: The Flex Component Kit (FCK) can now be found at http://www.adobe.com/go/flex3_cs3_swfkit.
In earlier Flex 3 betas, the FCK was included with the Flex SDK (see, "Installing the Flex Component Kit for Flash CS3" for more details on installing the component kit). In later SDK builds, we decided to remove the FCK from the SDK and post it separately online. Documentation for the FCK can be found at http://www.adobe.com/go/flex3_flexflashcomponents (PDF).

If you are an Fireworks CS3, Flash CS3, Illustrator CS3, and/or Photoshop CS3 user (or work with somebody who is), you'll also be pleased to know that you can find the Flex Skin Design Extensions at the same URL, http://www.adobe.com/go/flex3_cs3_swfkit. For more information on importing skins into Flex Builder, see http://www.adobe.com/go/flex3_skinning_doc (PDF_. Also, feel free to head over to blog.flexexamples.com and then check out my "Installing the Flex Skin Design Extensions for CS3 from Adobe Labs" entry (which is a bit out of date. but hopefully still somewhat relevant).