Rotate Effect and Non Embedded Fonts in Flex 4

This post was written by Greg Jastrab. Read other posts by Greg Jastrab.

One big improvement in Flash Player 10 is that fonts no longer need to be embedded in order to rotate text or alter it’s alpha. Below is a simple example demonstrating both of these features by using the Rotate and Fade effects in Flex 4.

(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)

Check out how simple the code is below!

TestRotate.mxml

<?xml version="1.0" encoding="utf-8"?>
<Application xmlns="http://ns.adobe.com/mxml/2009">
 
    <Declarations>
        <Rotate id="r" target="{btn}" angleTo="360" />
        <Fade id="a" target="{btnAlpha}"
              alphaFrom="1" alphaTo="0" duration="3000" />
    </Declarations>
 
    <VGroup horizontalCenter="0" verticalCenter="0">
        <Button id="btn" click="r.play()" label="Rotate This" />
        <Button id="btnAlpha" click="a.play()" label="Fade This" />
    </VGroup>
 
</Application>

Some changes to Gumbo since I’ve last posted:

  • Non visual items must go in a Declarations block (see MXML 2009 spec)
  • There are now HGroup and VGroup convenience classes so you can save some typing by not specifying the layout property

I hope everyone’s enjoying their Gumbo!

About the author: Greg Jastrab joined SmartLogic Solutions in June 2006 and leads all Flash/Flex/AIR development. Follow @gjastrab on twitter

Tags: , , ,

3 Responses to “Rotate Effect and Non Embedded Fonts in Flex 4”

  1. [...] Player 10?????????????????????????????http://blog.smartlogicsolutions.com/2008/09/25/rotate-effect-and-non-embedded-fonts-in-flex-4/http://d.hatena.ne.jp/nitoyon/20080927/p1  « [...]

  2. Jose Luis Perez says:

    Hi. I’m trying this example with flash 10 and the last flex 4 release and rotation works as in flex 3 (text dissapears). Can you check this? Any suggestions?

  3. Greg Jastrab says:

    Hm, I recompiled and go the same result. It did work for the fade, but disappeared in the rotate.

    The APIs and text engine SWCs have changed recently, so maybe it will come back in or I need to specify a new attribute. Note this isn’t rotating around the center by default anymore either.

Leave a Reply