Format ALL text fields?
hi -
i've searched everywhere , can't find answer this, appreciated. have movie multiple dynamic text fields. these text fields drawn movie @ frames (not created using as). text being dynamically created using flashvars.
i have global audience , dynamically embed fonts depending on country. so, flashvars section of html, have:
font=embed
or
font=noembed
(depending on country html file delivered to)
so, i'm using _sans default font on textfields (set in property inspector). i've got code in first frame of movie:
onenterframe = function (success) {
if (_root.font == "embed") {
textmc.text.settextformat(embedformat);
textmc.text.embedfonts = true;
}
}
var embedformat:textformat = new textformat();
embedformat.font = "luzsans-medium";
this working great single text field. however, i'd able set text format text fields in movie, rather having set each text field separately. there way this? way, because of target audience, need publish flash player 6, don't think can use css.
any ideas?
thanks!
miriam
i've searched everywhere , can't find answer this, appreciated. have movie multiple dynamic text fields. these text fields drawn movie @ frames (not created using as). text being dynamically created using flashvars.
i have global audience , dynamically embed fonts depending on country. so, flashvars section of html, have:
font=embed
or
font=noembed
(depending on country html file delivered to)
so, i'm using _sans default font on textfields (set in property inspector). i've got code in first frame of movie:
onenterframe = function (success) {
if (_root.font == "embed") {
textmc.text.settextformat(embedformat);
textmc.text.embedfonts = true;
}
}
var embedformat:textformat = new textformat();
embedformat.font = "luzsans-medium";
this working great single text field. however, i'd able set text format text fields in movie, rather having set each text field separately. there way this? way, because of target audience, need publish flash player 6, don't think can use css.
any ideas?
thanks!
miriam
hi,
i didn't try see if works, maybe it's possible use prototype property achieve this:
if (_root.font == "embed") {
textfield.prototype.settextformat(embedformat);
textfield.prototype.embedfonts = true;
}
}
this should affect textfields in movie (if affects anything...).
don't use onenterframe this; name misleading: executes repeatedly speed of frame rate, it's more onframechange (but executes repeatedly if there's 1 frame in movie).
so execute code every x ms, depending on frame rate. if assign code frame 1, without onenterframe, execute when playhead on frame, once if movie isn't looped. that's enough in case.
hth,
blemmo
i didn't try see if works, maybe it's possible use prototype property achieve this:
if (_root.font == "embed") {
textfield.prototype.settextformat(embedformat);
textfield.prototype.embedfonts = true;
}
}
this should affect textfields in movie (if affects anything...).
don't use onenterframe this; name misleading: executes repeatedly speed of frame rate, it's more onframechange (but executes repeatedly if there's 1 frame in movie).
so execute code every x ms, depending on frame rate. if assign code frame 1, without onenterframe, execute when playhead on frame, once if movie isn't looped. that's enough in case.
hth,
blemmo
More discussions in ActionScript 1 and 2
adobe
Comments
Post a Comment