# Dynamic text

**URL:** <https://forum.kirupa.com/t/dynamic-text/326343>\
**Category:** Uncategorized\
**Created:** [December 7, 2011, 7:26pm UTC](https://forum.kirupa.com/t/dynamic-text/326343 "2011-12-07T19:26:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![idans](https://avatars.discourse-cdn.com/v4/letter/i/b19c9b/32.png) [@idans](https://forum.kirupa.com/u/idans)\
**Post date:** [December 7, 2011, 7:26pm UTC](https://forum.kirupa.com/t/dynamic-text/326343/1 "2011-12-07T19:26:33Z")

</div>

Hi,

I wrote a code that’s suppose to change the number in a synamic text whn I press a button,  
What did I do wrong?

Object(root).currentNum=1;  
Object(root).pageNum.text = Object(root).currentNum;  
Object(root).arrowLeft.addEventListener(MouseEvent.CLICK, arrowLeftClick);  
function arrowLeftClick (e:MouseEvent):void{  
Object(root).currentNum-=1;  
}
