Tutorial of Text Feilds inside movie clips
- June 19th, 2010
- Posted in Flash
- Write comment
Here is a small tutorial of all you need for text feild inside a movie clip.
First we should create our movie clip
createEmptyMovieClip(“fudge”,i);
Now Lets create our text feild inside of the movieClip fudge
with (“fudge”) {
createTextField(“my_title”,getNextHighestDepth(),0,0,350,20);
}
Nice now we have a text feild that is called my_title and that is inside fudge we can even control several things of that text feild, like height, html, border, multiline and so on here if we continue with the with scope again
with (“fudge”) {
createTextField(“my_title”,getNextHighestDepth(),0,0,350,20);
my_title.autoSize = “left”;
my_title.wordWrap = true;
my_title.multiline = true;
my_title.border = false;
my_title.html = false;
my_title.text =” This should be a long text to test the auto height of the text feild we are creating and check if its working well”;}
Since we put autoSize to left and multiline and autowrap to true then the textFeild will grow by height.
Now Finally, We also can add text Format to color our text and choose the fontĀ size here is what we do
var title_format:TextFormat = new TextFormat();
title_format.color = 0xEBCF4E;
title_format.font = “Tahoma”;
title_format.size = 11;
title_format.bold = true;
But also we shouldnt forget to style the thing we’ve started so here
my_title.setTextFormat(title_format);
Now this shouldnt go with the text thing at all but I always prefer to adjust the height of the movieClip to the height of Text incase I want to use the movieClip height later so here how to do it
with (“fudge”) {
_height = my_title._height;
}
So now if I want to add any movie beneath Fudge all what I have to do is
myNewMovie._y= fudge._height+fudge._y;
Thats all folks. hope this was helpful enough for you ^^”
No comments yet.