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

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

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 17, 2004, 11:53pm UTC](https://forum.kirupa.com/t/actionscript-as-tag-solution-kinda/113445/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:
