Looping through Dictionary objects

I’m trying to do something along the following:

//Loop through all items in the dictionary to update each and every one
for (var key:DisplayObjectContainer in containerDict) 
{ 
   containerDict[key].updateText(); 
}

And Flash tells me “key” is supposed to be a String. Well, I could easily do that, no problems, even though I know all items in the containerDict are DisplayObjectContainers, so it’s probably treating the key as a String instead of an object. That’s understandable.

The problem comes in when I want to do this:

//Loop through all items in the dictionary and remove each one of them
for (var container:DisplayObjectContainer in containerDict) 
   { DebugText.remove(container); } 

Actually, it doesn’t remove the container, it deletes the DebugText instance associated with that container.

Here, there is no way I can treat the key as a string.

Any workarounds?