# ActionScript \[as\] Tag Solution - Kinda!

**URL:** <https://forum.kirupa.com/t/actionscript-as-tag-solution-kinda/54836>\
**Category:** random\
**Created:** [June 17, 2004, 11:53pm UTC](https://forum.kirupa.com/t/actionscript-as-tag-solution-kinda/54836 "2004-06-17T23:53:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [June 17, 2004, 11:53pm UTC](https://forum.kirupa.com/t/actionscript-as-tag-solution-kinda/54836/1 "2004-06-17T23:53:55Z")

</div>

Hey everyone,  
After spending a few days trying to get a temporary AS tag solution without sending the code through an AS formatter, I did manage to find a way (with help from the people at [vb.org](http://vb.org)) to recreate code functionality for AS:

```auto
bold.onRelease = function() {
    format = new TextFormat();
    format.bold = true;
    tfield.setTextFormat(format);
};
italic.onRelease = function() {
    format = new TextFormat();
    format.italic = true;
    tfield.setTextFormat(format);
};
underline.onRelease = function() {
    format = new TextFormat();
    format.underline = true;
    tfield.setTextFormat(format);
};
border.onRelease = function() {
    tfield.border = true;
    tfield.borderColor = 0xA4A4A4;
};
bground.onRelease = function() {
    tfield.background = true;
    tfield.backgroundColor = 0xD6E1F1;
};
fontcolor.onRelease = function() {
    format = new TextFormat();
    format.color = 0xFF0099;
    tfield.setTextFormat(format);
};
//reset button
reset.onRelease = function() {
    format = new TextFormat();
    format.bold = false;
    format.italic = false;
    format.underline = false;
    format.color = 0x1A5266;
    tfield.setTextFormat(format);
    tfield.border = false;
    tfield.background = false;
}

```

I think this is better than the current method which does not preserve spacing!

Cheers!  
Kirupa :ub:
