Home Tutorial Flex Flex4 Components MX Effect with embedded font in Flex4

 
 

Share on Google+Share on Google+
MX Effect with embedded font in Flex4
Posted on: July 2, 2010 at 12:00 AM
Advertisement
We can use the embedded font when we are working with Fade and Rotate effect.

MX Effect with embedded font in Flex4:

We can use the embedded font when we are working with Fade and Rotate effect. Because the Fade and Rotate effect support the Flash Text Engine(FTE) or an embedded font. In this example you can see how we can use an embedded font with effect. In the following example we rotate a TextArea which has an embedded text font. When we rotate the first TextArea then an embedded text font will also rotate. When we rotate the second TextArea then the simple font will not rotate and it will be invisible.

Example:

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

xmlns:s="library://ns.adobe.com/flex/spark"

xmlns:mx="library://ns.adobe.com/flex/mx"

minWidth="955" minHeight="600">

<fx:Style>

@namespace s "library://ns.adobe.com/flex/spark";

@namespace mx "library://ns.adobe.com/flex/mx";

@font-face {

src:url("MyriadWebPro.ttf");

fontFamily: fontFamily1;

embedAsCFF: true;

}

</fx:Style>

<fx:Declarations>

<mx:Rotate angleFrom="0"

angleTo="180"

id="rotateClockWise"

duration="500"/>

<mx:Rotate angleFrom="180"

angleTo="0"

id="rotateAntiClockWise"

duration="500"/>

</fx:Declarations>

<s:Panel title="Using embedded font with MX effects"

chromeColor="#000000" color="#CCCCCC" width="450" height="321">

<mx:ApplicationControlBar

color="#000000" width="448" horizontalAlign="center">

<s:Label text="Click on TextArea and show the effect" fontFamily="Verdana"/>

</mx:ApplicationControlBar>

<s:TextArea

text="This is a Embedded font . This text will rotate."

fontFamily="fontFamily1"

x="106" y="94"

height="26" width="252"

color="#000000"

mouseDownEffect="{rotateClockWise}"

mouseUpEffect="{rotateAntiClockWise}"/>

<mx:TextArea

text="This is a Simple font . This text will not rotate."

x="106" y="143"

height="26" width="252"

color="#000000"

mouseDownEffect="{rotateClockWise}"

mouseUpEffect="{rotateAntiClockWise}"/>

</s:Panel>

</s:Application>

Output:

Running Application:

To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.

Download this code

Advertisement

Related Tags for MX Effect with embedded font in Flex4:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 2, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com