Skip to content

Commit

Permalink
Removed listener for stage_added event
Browse files Browse the repository at this point in the history
  • Loading branch information
apa authored and apa committed Nov 12, 2010
1 parent b946fab commit 841da21
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions src/com/jabbypanda/controls/InputAssist.as
Expand Up @@ -87,7 +87,6 @@ package com.jabbypanda.controls {
public function InputAssist() {
super();
this.mouseEnabled = true;
this.addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
dataProvider = null;
}

Expand Down Expand Up @@ -232,10 +231,10 @@ package com.jabbypanda.controls {
if (instance == inputTxt) {
inputTxt.text = _enteredText;

inputTxt.addEventListener(FocusEvent.FOCUS_IN, onInputFieldFocusIn);
inputTxt.addEventListener(FocusEvent.FOCUS_OUT, onInputFieldFocusOut);
inputTxt.addEventListener(TextOperationEvent.CHANGE, onInputFieldChange);
inputTxt.addEventListener(KeyboardEvent.KEY_DOWN, onInputFieldKeyDown);
inputTxt.addEventListener(FocusEvent.FOCUS_IN, onInputFieldFocusIn, false, 0, true);
inputTxt.addEventListener(FocusEvent.FOCUS_OUT, onInputFieldFocusOut, false, 0, true);
inputTxt.addEventListener(TextOperationEvent.CHANGE, onInputFieldChange, false, 0, true);
inputTxt.addEventListener(KeyboardEvent.KEY_DOWN, onInputFieldKeyDown, false, 0, true);
}

if (instance == list) {
Expand All @@ -246,7 +245,7 @@ package com.jabbypanda.controls {
list.requireSelection = requireSelection;
list.styleName = new StyleProxy(this, {});

list.addEventListener(HighlightItemListEvent.ITEM_CLICK, onListItemClick);
list.addEventListener(HighlightItemListEvent.ITEM_CLICK, onListItemClick, false, 0, true);
}
}

Expand Down Expand Up @@ -485,17 +484,7 @@ package com.jabbypanda.controls {
showPreviousTextAndHidePopUp(!_completionAccepted);
}
}

private function onAddedToStage(event : Event) : void {
focusManager.addEventListener(FlexEvent.FLEX_WINDOW_ACTIVATE, onFlexWindowActivate);
}

private function onFlexWindowActivate(event : FlexEvent) : void {
/* reset lastFocus value to prevent shifting focus
to previously selected component
*/
(focusManager as FocusManager).lastFocus = null;
}


private var _collection : ArrayCollection = new ArrayCollection();

Expand Down

0 comments on commit 841da21

Please sign in to comment.