// Populate this handler scope with a definition for the 'event' parameter.
// The type of this parameter is determined by the [Event] metadata.
// For example, if the event is
// [Event(name="click", type="flash.events.MouseEvent")]
// then the type is flash.events.MouseEvent.
IReference typeRef = ((DefinitionBase)getDefinition()).getTypeReference();
scope.buildEventParameter(typeRef);
// Add an expression dependency on the event type.
// It doesn't need to be a signature dependency
// because autogenerated event handlers are inaccessible;
// they're either in a special private MXML namespace
// or they're public but have an 'illegal' name.
typeRef.resolve(builder.getProject(), scope, DependencyType.EXPRESSION, true);
// Make the statements inside the event handler the children of this node.
for (ScopedBlockNode script : scripts)
{
int n = script.getChildCount();