i have decided to put this question separate since i mention it in later thread of mine, i have problems centering dynamic text vertically in text box. I tried this
and it work perfectly when i try preview in flash player, text is centered, but in caspar it does not. Like caspar ignoring this command. Is there any other way to do this? f0 is name of textbox.
The error is from an object, that is not found. Is sym2 the instance name of a Movieclic, where the TextField f0 is contained in? No other MovieClip around it? And present in frame 1 on the timeline?
By the way: I would not add (+=) to the fields y property, as when you update, the Textfield will move every time. Instead use a hardcoded value and add to that.
textbox f0 is in sym2 movie clip, and they are on root timeline, from beginning of animation, and if i just declare it as f0.y in .as file i get error in exporting and can not export template, only if i write it as sym2.f0.y then i can export it, but when i put it in .as file, i get this error and no template displayed on air
Well, after lot of brainstorming, I have recreated template from beginning and after that i added in .as file this code, after super.SetData(xmlData);
super.SetData(xmlData);
var x:int = textpit.f0.length;
if (x<=52)
{
textpit.f0.y = textpit.f0.y + 25;
}
else if (x>52 && x<=104)
{
textpit.f0.y = textpit.f0.y + 20;
}
else if (x>104 && x<=156)
{
textpit.f0.y = textpit.f0.y + 10;
}
else if (x>156 && x<=208)
{
textpit.f0.y = textpit.f0.y + 8;
}
it basically takes characters count of text box and pass it to int variable x, and then i check it for several lengths, which are actually lines of text and position it onscreen to be centered. Hope someone will find it helpful. Now it works perfectly.