How to configure Creative TextFX from AS

In this tutorial we will work mainly from the Actions panel; we will instantiate and configure a Creative TextFX component from code, without adding anything to the library of the file.

Firstly I just want to remind you that, in order to be able to solve the tutorial, you will need the Creative TextFX extension installed on your computer; if you encounter any problems while doing that, please visit the “How to install an extension” tutorial.


Click here to download the source file and the required files for solving this tutorial.


1. Let’s start by opening Flash and creating a new Flash file – ActionScript 3.0. Right click on the stage to open the Document Properties window. Name the file “How to configure Creative TextFX from AS”, set its dimensions to 450x250 pixels and the background color to white (#FFFFFF). Set the frame rate to 35 fps.

Create a new Flash file

Create a new Flash file

2. From The Components panel (CTRL+F7), please drag a Creative TextFX instance in your file’s Library.

Drag a Creative TextFX instance in the Library

Drag a Creative TextFX instance in the Library

3. From the Tools panel (CTRL+F2) select the Text Tool.

Select the Text tool

Select the Text tool

4. Insert a text instance on the stage and insert inside the following text: “I love Creative TextFX !”.

Insert a text instance on the stage

Insert a text instance on the stage

5. Let’s configure the text instance as in the image below: set it to be a dynamic text, Arial size 26, color black, bolded and italicized, left aligned with the pacing coordinates as specified in the image, such that it will be outside the stage.

Configure the text properties

Create a new Flash file

6. Click Embed to select the characters you want to embed; use the Auto Fill option for an optimal embedding.

Embed the used characters

Embed the used characters

7. In the same frame where the text resides, insert the following code in the Actions panel.

import xtd.textFX_v2.effects.ShockingFlakesEffect;
import xtd.textFX_v2.effects.NoneEffect;
import xtd.textFX_v2.effects.BlindsEffect;
import xtd.textFX_v2.presets.actions_NoneEffect;
import xtd.textFX_v2.presets.out_BlindsEffect;
import xtd.textFX_v2.presets.wait_ShockingFlakesEffect;
import xtd.textFX_v2.TextFXMain;
var tfx : TextFXMain;
var a : BlindsEffect;
var b : ShockingFlakesEffect;
var c : xtd.textFX_v2.effects.NoneEffect;
this["textField"].visible = false;
tfx = new TextFXMain(
this, 
"BlindsEffect",
"ShockingFlakesEffect",
"BlindsEffect",
"NoneEffect",
“ordering=Random;delayBetweenPieces=0.32;blindColor=10092441;gradientPosition=Center;numberOfBlinds=8;animateText=true;duration=50;easingType=Strong.easeInOut;blockType=Line”,
wait_ShockingFlakesEffect.Extend_Default,
out_BlindsEffect.Extend_Default,
actions_NoneEffect.Extend_Default,
TextField(this["textField"]).htmlText,
null,
"delayTime=0;loop=true;useIn=true;useWait=true;afterInDelay=0;afterWaitDelay=0;useOut=true;useInAsOut=true;useMove=true;moveDuration=150;moveFromX=200;moveFromY=200;moveEasing=None.easeNone;"
 );
tfx.container.x = 10;
tfx.container.y = 10;
tfx.start();

8. Preview your file.

Preview your file

Preview your file

Thank you for your time and I hope this tutorial was useful to you. I invite you to read the rest of our tutorials and check out our other products on www.extendstudio.com. If you have any questions or suggestions please contact me at jon.stanciu@extendstudio.com.