# Updating dynamic text box for simple rpg

**URL:** <https://forum.kirupa.com/t/updating-dynamic-text-box-for-simple-rpg/309713>\
**Category:** flash\
**Created:** [May 22, 2010, 2:03am UTC](https://forum.kirupa.com/t/updating-dynamic-text-box-for-simple-rpg/309713 "2010-05-22T02:03:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![overlordlink](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@overlordlink](https://forum.kirupa.com/u/overlordlink)\
**Post date:** [May 22, 2010, 2:03am UTC](https://forum.kirupa.com/t/updating-dynamic-text-box-for-simple-rpg/309713/1 "2010-05-22T02:03:34Z")

</div>

Hey everyone im trying to learn and understand actionscript 2.0… so i figured the first thing i would do is make a simple rpg. What i have done so far is make 4 way movement and now im trying to make a hitTest where the “char” touches the coin and it updates the dnyamic text with the instance of currency and then unload the clip. But when i run it neither of these happen can someone please help???

and the code i have on the frame is

```auto

currency = 0

```

and the code i have on the coin is

```auto

onClipEvent(enterFrame) {
if (this.hitTest(_root.char))
this.removeMovieClip();
_root.currency += 1
}

```

and its instance name is coin

and the character code is

```auto

onClipEvent(load)
{
var speed=7;

}
onClipEvent(enterFrame)
{
    if (Key.isDown(Key.RIGHT)) {
    this._x=_x+=speed;
    this.gotoAndPlay(2);
} else {
    if (Key.isDown(Key.LEFT)) {
    this._x=_x-=speed;
    this.gotoAndPlay(3);
} else {
    if (Key.isDown(Key.UP)) {
    this._y=_y-=speed;
    this.gotoAndPlay(4);
} else {
    if (Key.isDown(Key.DOWN)) {
    this._y=_y+=speed;
    this.gotoAndPlay(5);
} else {
gotoAndStop(1);
}
}
}
}
}

```

and its instance name is char

also i am using flash cs4 so if you need me to reupload it in older format just ask.
