Masking graphics drawn with AS


maybe some flash gurus can help me with the following problem.

i have a small user interface with some buttons. there is an area where a map is drawn (by using action script). if i zoom the map it comes bigger and goes out of that area.
is there a easy solution to mask the map area so that only the fragment of map is shown while zooming?
is seems that the usual layer mask does not work while graphics is done by script.