In this tutorial we will work mainly from the Actions panel; we will instantiate and configure a Creative MovieFX 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 MovieFX 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 MovieFX from AS”, set its dimensions to 350x250 pixels and the background color to white (#FFFFFF). Set the frame rate to 35 fps.

Create and configure a new Flash file
2. From The Components panel (CTRL+F7), please drag a Creative MovieFX instance in your file’s Library.

Drag a Creative MovieFX instance in the Library
3. Extract the attached archive in the folder of your choice. From the Flash top menu, select “File>Import>Import to stage” or click CTRL+R; import the image to the stage and place it at coordinates X=25, Y=25.

Import the image to the specified coordinates
4. With the picture still selected, click F8 or select “Modify>Convert to Symbol”, and convert it to a movie clip. Let’s name both the movie clip and its instance on the stage “target”.

Convert the image to a movie clip

Rename the movie clip instance on the stage
5. In the same frame where the movie clip resides, insert the following code in the Actions panel.
import xtd.movieFX_v2.effects.PixelateEffect; import xtd.movieFX_v2.effects.NoneEffect; import xtd.movieFX_v2.presets.in_PixelateEffect; import xtd.movieFX_v2.presets.wait_NoneEffect; import xtd.movieFX_v2.presets.out_PixelateEffect; import xtd.movieFX_v2.presets.actions_NoneEffect; import xtd.movieFX_v2.MovieFXMain; var mfx : MovieFXMain; var a:PixelateEffect; mfx = new MovieFXMain( target, "PixelateEffect", "NoneEffect", "PixelateEffect", "NoneEffect", in_PixelateEffect.Extend_Default, wait_NoneEffect.Extend_Default, out_PixelateEffect.Extend_Default, actions_NoneEffect.Extend_Default, "delayTime=0;loop=true;useIn=true;useWait=true;afterInDelay=0;afterWaitDelay=0;useOut=true;useInAsOut=true;useMove=true;moveDuration=120;moveFromX=25;moveFromY=75;moveEasing=None.easeNone;" ); mfx.container.x = 25; mfx.container.y = 25; mfx.start();
6. Press Ctrl+Enter in order to 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.