Dynamic text tween
For dynamic text the font has to be embedded to do the same thing. Embedding dynamic font is done in the following way. Open the symbol library and go to the menu and click on new font. Give a new name for the font like "fontnameEmbed". Then write the name of the font (for example "Times") in the line called "font" and click ok. The font is now in the library. Now highlight the font symbol in the library and in the menu go to "linkage" and check the box which says "Export for actionscript". If you are loading the movie into a movieclip like I did here you have to do the same procedure in the parent movie also. Otherwise it would not work.
In the action keyframe put the following script. You can of course add things for you textfield.
//create new dynamic textfield
this.createTextField("dynamicText",5,200,60,240,40);
//set embbedding fonts true
dynamicText.embedFonts=true;
//write you text here
dynamicText.text="Dynamic Textfield";
//define some style properties and include the name of the font
textStyle = new TextFormat();
textStyle.font="impactEmbed";
textStyle.color=0xFF0000;
textStyle.size=30;
dynamicText.setTextFormat(textStyle);
Changing width and moving tweens
To change the width of an object like a curtain for example instead of alpha use "_width" and the values and for moving an object replace it by "_x" or "_y" or both. Download the sample file and check the scripts. There is also another script for dynamically created objects, which is similar as for other objects.
Color fading
MovieClip.prototype.fadeIn=function(fadeSpeed){
//we first define the object's color value by splitting the RGB into the individual values.
The color shown here will give yellow.
myColor=new Object();
myColor.rb = 255;
myColor.gb = 255;
myColor.bb = 05;
myNewColor = new Color(myObject);
myNewColor.setTransform(myColor);
this.onRollOver=function(){
//defining the interval function
myPause = new Object();
myPause.interval = function() {
//We use one of the color determinant for the tween and decrease its value...
if(myColor.rb > 05){
myColor.rb -=fadeSpeed;
myColor.gb -=fadeSpeed;
myColor.bb -=fadeSpeed;
myNewColor.setTransform(myColor);
}else {
//...until the final color value is reached.
myColor.rb = 05;
myColor.gb = 05;
myColor.bb = 255;
myNewColor.setTransform(myColor);
clearInterval(myTimer);
}
}
myTimer = setInterval( myPause, "interval", 20);
}
//We repeat this for the reverse change.
this.onRollOut=function(){
myPause = new Object();
myPause.interval = function() {
if(myColor.rb < 255){
myColor.rb +=fadeSpeed;
myColor.gb +=fadeSpeed;
myColor.bb +=fadeSpeed;
myNewColor.setTransform(myColor);
}else {
myColor.rb = 255;
myColor.gb = 255;
myColor.bb = 05;
myNewColor.setTransform(myColor);
clearInterval(myTimer);
}
}
myTimer = setInterval( myPause, "interval", 20);
}
}
button6.fadeIn(10);