Hey, this surely is a newbie question... but here it goes anyway:

I'm trying to make a simple rpg game and I would like to add something like a pop-up text box for the dialog that shows when the character interact with the npcs/items
(like on this game: http://www.mspaintadventures.com/?s=6&p=004692)
but I can't figure out how to do it.
I'm already using a text function that I learned on a tutorial but it isn't exactly what I wanted. I can't even open and close the text with the same key...

PHP Code:
onClipEvent (enterFrame) {
    
distance 45;
    
ux _root.char._x;
    
uy _root.char._y;
    
hx this._x;
    
hy this._y;
    if(
Math.sqrt((ux-hx)*(ux-hx)+(uy-hy)*(uy-hy))<distance && Key.isDown(Key.SPACE)) {
        
_root.TextInstance.text "text goes here";
    } 
    if (
Key.isDown(Key.SHIFT)) {
        
_root.TextInstance.text "";
    }
    

So I would really appreciate some help with this
If someone could link me to a tutorial or whatever that could help it would be awesome