Pacman help

hey everyone. ive recently started work on pacman in flash, its all done except the ghosts. does anyone know how youd get an object to follow an imported text file or string such as “rrrrlllluuuuudddddrrrrllllluuuuuddddrrrr” where r = right, l = left, u = up, and d= down. so that every time the ghost moves x amount in that direction in the text file? any help would be appreciated :kommie: