I'm just going to put this code on the timeline for simplicity's sake, but you may set up a class, if you prefer. First, we have the variable that will store the com.yahoo.maps.api.YahooMap instance. I typed it as Object because we don't have a compile-time reference to the required class and Object is most flexible being dynamic.
Coding Library: Flash/Actionscript

More Yahoo Maps Resources: