getTextFormat issue ... ?
Hi, I've decided to try out tracing the fonts properties one by one till I find the ones I need but I am probably doing something wrong here because the trace doesn't seem to match the font that displays on screen. I've also tried using getNewTextFormat instead of getTextFormat but besides not really knowing the difference between them, the trace is almost the same and the text keeps being different on screen. What would the correct syntax be, please?
Code:
stop();
var select:Number;
var aFonts:Array = ["TR", "TB", "TI", "TBI", "CR", "CB", "CI", "CBI", "APR", "APB", "API", "APBI", "TMR", "TMB", "TMI", "TMBI", "VR", "VB", "VI", "VBI", "AR", "AB", "AI", "ABI"];
select = Math.floor(Math.random() * aFonts.length);
this.createTextField("my_txt", 1, 100, 100, 300, 100);
my_txt.multiline = true;
my_txt.wordWrap = true;
var my_fmt:TextFormat = new TextFormat();
my_fmt.font = aFonts[select];
my_fmt.size = 24;
my_fmt.bold = true;
my_fmt.italic = true;
my_fmt.color = 0x000033;
my_txt.text = "This is a test.";
my_txt.embedFonts = true;
my_txt.antiAliasType = "advanced";
my_txt.selectable = false;
my_txt.setTextFormat(my_fmt);
var my_fmt:TextFormat = my_txt.getTextFormat();
for (var prop in my_fmt)
{
trace(prop + ": " + my_fmt[prop]);
}
trace("----------------------");
No problem about that.... I'll solve it in time, but one last question, please
I'm trying to loop a function as soon as the alpha from my text fades out completely, but I've read somewhere that alpha may not reach exactly 0 and don't know how to handle this problem.
this is the function i have in the main timeline:
Code:
function attachClips():Void{
attachMovie("independencia_mc","independencia",this.getNextHighestDepth(),{_x:200, _y:350});
}
attachClips();
and this is in an attached clip that calls the fadeout function onSoundComplete:
Code:
fadeOutInd = function():Void{
trace(ind._alpha);
trace(ind);
new Tween(ind, "_alpha", None.easeNone, ind._alpha, 0, 2, true);
if(ind._alpha == 0){
ind.removeTextField();
_parent.attachClips();
}
}
but it doesn't work and I don't remember, or don't know how to get the alpha's trace in the conditional statement so I have no clue whether it reaches 0. A way to repeat this would be appreciated, the final objective is to have it run endlessly showing up on any spot on stage until the user clicks on the screen to close the window.
Attachment 74849