# Target.my\_txt ... font size?!

**URL:** <https://forum.kirupa.com/t/target-my-txt-font-size/263007>\
**Category:** Uncategorized\
**Created:** [June 11, 2008, 8:35pm UTC](https://forum.kirupa.com/t/target-my-txt-font-size/263007 "2008-06-11T20:35:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kempo](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@kempo](https://forum.kirupa.com/u/kempo)\
**Post date:** [June 11, 2008, 8:35pm UTC](https://forum.kirupa.com/t/target-my-txt-font-size/263007/1 "2008-06-11T20:35:03Z")

</div>

Hello! I’m stuck, I don’t usually do actionscripting much and I cannot figure out how to change the size of this font

```auto
fullPreloader.onLoadStart = function(target) {
        target.createTextField("my_txt",fullImage_mc.getNextHighestDepth,0,400,200,20);
        target.my_txt.selectable = false;
        target.my_txt.textColor = "0xFFFFFF";
        
    };

```

i wanted to do something like how I change the color…just target.my\_txt.textSize = But nothing seems to work, any ideas?! Thanks for any help!

James

---

<div class="post-metadata">

**Author:** ![glosrfc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/glosrfc/32/8334_2.png) [@glosrfc](https://forum.kirupa.com/u/glosrfc)\
**Post date:** [June 12, 2008, 1:11am UTC](https://forum.kirupa.com/t/target-my-txt-font-size/263007/2 "2008-06-12T01:11:30Z")

</div>

```auto
fullPreloader.onLoadStart = function(target) {
        target.createTextField("my_txt",fullImage_mc.getNextHighestDepth,0,400,200,20);
        target.my_txt.selectable = false;
        target.my_txt.textColor = "0xFFFFFF";
// apply new format to textfield if changing existing text
        myformat.size = 20;
        target.my_txt.setTextFormat(myformat);
// alternatively use 
// target.my_txt.setNewTextFormat(myformat); 
// to change text added to textfield
};

```

---

<div class="post-metadata">

**Author:** ![congyaan](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@congyaan](https://forum.kirupa.com/u/congyaan)\
**Post date:** [June 12, 2008, 9:06am UTC](https://forum.kirupa.com/t/target-my-txt-font-size/263007/3 "2008-06-12T09:06:37Z")

</div>

What a pity that i see this thread so late,I wasted a lot of time on setTextFormat and setNewTextFormat,because I made the wrong order.

---

<div class="post-metadata">

**Author:** ![glosrfc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/glosrfc/32/8334_2.png) [@glosrfc](https://forum.kirupa.com/u/glosrfc)\
**Post date:** [June 12, 2008, 7:26pm UTC](https://forum.kirupa.com/t/target-my-txt-font-size/263007/4 "2008-06-12T19:26:25Z")

</div>

Yes, it’s easily done.

setTextFormat changes text that already exists in a textfield. Any new text will revert back to the original format.

setNewTextFormat doesn’t change text that is already in a texfield. But any new text will reflect the new formatting.

---

<div class="post-metadata">

**Author:** ![gibry21](https://avatars.discourse-cdn.com/v4/letter/g/3bc359/32.png) [@gibry21](https://forum.kirupa.com/u/gibry21)\
**Post date:** [June 17, 2008, 10:04pm UTC](https://forum.kirupa.com/t/target-my-txt-font-size/263007/5 "2008-06-17T22:04:06Z")

</div>

Hi guys,

Just a quickie, following on from the previous text format question, I to am a novice with this stuff…

I managed to use the above script and get my color changed…but ur suggestion for size doesnt seem to work…

Works fine - target.my\_txt.text = myTitle;  
Works fine - target.my\_txt.textColor = “0xFFFFFF”;

No effect on text -myformat.size = 20;  
No effect on text -target.my\_txt.setNewTextFormat(myformat);

Any suggestions? Also tried the othe way you suggested. And while I’m here, do you use the same technique to change font style?

Thanks.

My Code: Sorry its messy and has comments:

fullPreloader.onLoadComplete = function(target) {  
//new Tween(target, “\_alpha”, Strong.easeOut, 0, 100, .5, true);  
//var myTextTween = new Tween(target.my\_txt, “\_y”, Strong.easeOut, myText\_y, -20, 0.5, true);  
//target.my\_txt.text = myTitle;  
//- Start of Glow  
if (!myFil) {  
\_global.myFil = true;  
var myGlow = new flash.filters.DropShadowFilter();  
myGlow.color = 0xffffff;  
myGlow.alpha = 0.4;  
var myTempFilters = fullImage\_mc.filters;  
myTempFilters.push(myGlow);  
fullImage\_mc.filters = myTempFilters;  
}  
//- End of Glow  
var myFadeIn = new Tween(target, “\_alpha”, Strong.easeOut, 0, 100, 0.5, true);

var myText\_y = target.my\_txt.\_y;

```
    target.my_txt.text = myTitle;

```

target.my\_txt.textColor = “0xFFFFFF”;  
myformat.size = 20;  
target.my\_txt.setNewTextFormat(myformat);

```
    //target.my_txt.embedFonts = false;
    //target.my_txt.setTextFormat(_root.my_fmt);
    var myTextTween = new Tween(target.my_txt, "_y", Strong.easeOut, myText_y, -20, 0.5, true);

```

};
