# Possible to put dynamic text in a graphic?

**URL:** <https://forum.kirupa.com/t/possible-to-put-dynamic-text-in-a-graphic/294897>\
**Category:** flash\
**Created:** [August 21, 2009, 4:15pm UTC](https://forum.kirupa.com/t/possible-to-put-dynamic-text-in-a-graphic/294897 "2009-08-21T16:15:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shazzmoe](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@shazzmoe](https://forum.kirupa.com/u/shazzmoe)\
**Post date:** [August 21, 2009, 4:15pm UTC](https://forum.kirupa.com/t/possible-to-put-dynamic-text-in-a-graphic/294897/1 "2009-08-21T16:15:54Z")

</div>

```auto

            this.upgradeMC = new Sprite();
            var g :Graphics = this.upgradeMC.graphics;
            g.lineStyle(1, 0x454545);
            g.beginFill(0xaaaaaa);
            g.drawRect(0, -25, 100, 50);
            g.endFill();
                        
            this.upgradeMC.x += 50;
            //this.upgradeMC.y = 0;
            this.addChild(this.upgradeMC);

```

The above draws a grey, clickable box that appears when a button is clicked in my game. It will not always be in the same spot on screen and I need to have this box labeled with with text that is not always the same. I can’t find a graphic function like drawText so is there a way to do this?
