Google Map AS3 error. 1046

http://www.kirupa.com/developer/as3/flash_as3_google_maps_api_pg2.htm
1046: Type was not found or was not a compile-time constant: DirectionsEvent.
I highlighted the line with error in RED. The code is as follows:
import com.google.maps.LatLng;
import com.google.maps.Map;
import com.google.maps.MapEvent;
import com.google.maps.MapType;
import com.google.maps.InfoWindowOptions;
import com.google.maps.LatLngBounds;
import com.google.maps.MapMoveEvent;
import com.google.maps.overlays.Marker;
import com.google.maps.overlays.MarkerOptions;
import com.google.maps.interfaces.IPolyline;
import com.google.maps.services.*;

var dir:Directions;
var polyline:IPolyline;
var map:Map

function setupMap() {
map = new Map();
map.key=“ABQIAAAAh8LfxQ8YLf1biQWzuFIxzxQSOn345XElUGjUlW3_TRSFT8fI1BSxauGJGfMCQCKzhMONHnGM-4nk1Q”;
map.setSize(new Point(400,400));
map.x=0;
map.y=0;
map.addEventListener(MapEvent.MAP_READY, onMapReady);
this.addChild(map);
}
setupMap();

function onMapReady(event:Event):void {
dir = new Directions();
dir.addEventListener(DirectionsEvent.DIRECTIONS_SUCCESS,onDirectionsLoaded);
dir.load(“121 Kings Road, Westampton, NJ to 300 Mill Street, Bristol, PA”);
}
function onDirectionsLoaded(event:DirectionsEvent):void {
[COLOR=Red]var returnedDirection:Directions=event.directions;[/COLOR]

var startLatLng:LatLng=returnedDirection.getRoute(0).getStep(0).latLng;
var endLatLng:LatLng=returnedDirection.getRoute(returnedDirection.numRoutes-
                                                1).endLatLng;

polyline=returnedDirection.createPolyline();

map.clearOverlays();
map.addOverlay(polyline);
map.addOverlay(new Marker(startLatLng));
map.addOverlay(new Marker(endLatLng));
map.setCenter(returnedDirection.bounds.getCenter(),
                                                  map.getBoundsZoomLevel(returnedDirection.bounds));

}

I changed the Google API Key and the address that were in the code found on this site.
is there an easy fix for this?