# Formating Text

**URL:** <https://forum.kirupa.com/t/formating-text/256439>\
**Category:** flash\
**Created:** [April 3, 2008, 12:47am UTC](https://forum.kirupa.com/t/formating-text/256439 "2008-04-03T00:47:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alpharaven](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@alpharaven](https://forum.kirupa.com/u/alpharaven)\
**Post date:** [April 3, 2008, 12:47am UTC](https://forum.kirupa.com/t/formating-text/256439/1 "2008-04-03T00:47:22Z")

</div>

I am trying to format text using a function thats within a class. For some reason the only way I can format it is by using an onEnterFrame function otherwise it wont work. Does anyone know why?

```auto
    public function MainFormant():Void
    {
        message_text.SettxtWidth(Stage.width);
        message_text.SetAlignment(2);
        message_text.SetFontSize(50);
        message_text.SetFontColor(StyleSheet.HOME);

    }

```
