Solved! Go to Solution.
AppEvent.dispatch(AppEvent.WIDGET_CHANGE_STATE, data);
AppEvent.dispatch(AppEvent.TOC_HIDDEN, widgetId);when the code example that Robert linked to uses:
AppEvent.dispatch(AppEvent.WIDGET_CLOSE, widgetId);
var data:Object = { id: widgetId, state: WidgetStates.WIDGET_MINIMIZED }; AppEvent.dispatch(AppEvent.WIDGET_STATE_CHANGED, data);
AppEvent.dispatch(AppEvent.WIDGET_CHANGE_STATE, data);