Briefly about effector?
The Effector is a Flash Actionscript 2.0 class which allows you to create and set effects on TextFields and MovieClips. The possibility to set effects on a given text field exists only if it's dynamic type. The posibility to set effects on MovieClips is not avaliable for now as this is still work in progress.
Simple example:
How to use Flash Effector?
First download Flash Effector (download effector version 1.0.0) and extract files. Extracted 'effector' folder copy in to root folder where is your mainProject.fla file. Now before you start creating effects it's necessary to do next two steps:
1. First of all you need to create dynamic TextField and set an instance name of TextField ( example "_text" ) and then embed your TextField. Now convert your TextField into a MovieClip symbol and set the instance name of MovieClip example "textHolder" and then again convert "textHolder" MovieClip in to a new MovieClip and set instance name of the new MovieClip (example "TextContainer") and that is it.
It's very important, that your TextField is always inside the second MovieClip (like in stated example: textContainer.textHolder._text) . Now if you want scroll your text you need to use "textContainer" MovieClip for scrolling. As well you can always attach "textContainer" MovieClip and use the same TextField for different needs.
2. Next you need to import TextEffector class inside your .fla file or inside your class file. You can do that very easy. If you are programming in timeline you can copy/paste this code in the same frame where your TextField is or you can paste this on top of your class code:
import effector.TextEffector;
Now everythign is ready for creating effects.
Definition of addEffect(); method:
//first we will attach "textContainer" on stage
var textContainer:MovieClip =_root.attachMovie("textContainer", "textContainer", 0);
var myText:TextField = textContainer.textHolder._text;
// now we will set some text inside 'myText' TextField
myText.text = "What is Flash Professional? Adobe® Flash® Professional software is the most advanced authoring environment for creating rich, interactive content for digital, web, and mobile platforms. Flash is the best :)....";
myText.multiline = true;
myText.autoSize = true;
myText.wordWrap = true;
//now we can call function addEffect
TextEffector.addEffect(myText, {effect:"exposeline", time:1, interval:0.300, line:1, transition:"linear"});
You can also set TextField SP2 preset effects. SP2 are included effects inside TextEffector class.
Example how to use SP2 effects:
//just in sp2preset paremeter set name of SP2 effects
TextEffector.addEffect(myText, {sp2preset:terminal});
List of all SP2 effects:
curtain
flow
terminal
expose
rapid
diagnostic
Here is one example where you can test SP2 effects and create your custom effects. preview download .fla
Parameters for addEffect(); method:
Here is the list of all parameters which are avaliable in addEffect() method.
time: Number, indicates time duration of effect which refer just one TextField line. If time is 1 (time:1) effect will lasts 1 second.
effect: String, for now you have the choice between two effects, "flashline" or "exposeline".
line: Number, with line parameter you can set how many lines you want to be displayed at once.
interval: is data type Number which indicates delay of effect.
transition: String. You can see list of all transitions types avaliable for effector clicking on this link http://code.google.com/p/tweener/wiki/Transitions
If you alredy have set effect on TextField and you want to change the text inside TextField you can use updateTextField() method.
Definition of updateTextField(); method:
//first we need change text
myText.text = "new String new information................";
//and now we can call updateTextField function
TextEffector.updateTextField(myText, {autoClose:true, DOWN:true});
Parameters for updateTextField(); method:
autoClose: Boolean, which allows you to set unload effect on TextField. If autoClose is true TextEffector will first create unload effect, and when unload effect finishes removing old text TextField text will be replaced with new text(String). After setting new text TextEffector will again set new effect for the new text with same properties as it was provided in addEffect() method before. If autoClose:false TextEffector will delete old text and then set new text with effect.
UP: Boolean. If autoClose:true and UP:true TextEffector will again create unload effect for TextField, but effect will start from bottom of TextField and move upwards.
DOWN: Boolean. DOWN parameter have same role like UP, but if DOWN:true unload effect will start from top of TextField and move downwards.
Next version of effector is comming soon with more powerful features
I hope this class will help you. If you run on some bugs please contact me on mirko[dot]fisic[at]gmail[dot]com

