diff --git a/source/feathers/controls/Button.as b/source/feathers/controls/Button.as index 55f9c7a26..943d47c1d 100644 --- a/source/feathers/controls/Button.as +++ b/source/feathers/controls/Button.as @@ -1957,9 +1957,10 @@ package feathers.controls { processStyleRestriction(key); } - if(format !== null) + var oldFormat:TextFormat = this._fontStylesSet.getFormatForState(state); + if(oldFormat !== null) { - format.removeEventListener(Event.CHANGE, changeHandler); + oldFormat.removeEventListener(Event.CHANGE, changeHandler); } this._fontStylesSet.setFormatForState(state, format); if(format !== null) diff --git a/source/feathers/controls/TextArea.as b/source/feathers/controls/TextArea.as index 346392de0..9a0abfd7c 100644 --- a/source/feathers/controls/TextArea.as +++ b/source/feathers/controls/TextArea.as @@ -1695,9 +1695,10 @@ package feathers.controls { processStyleRestriction(key); } - if(format !== null) + var oldFormat:TextFormat = this._fontStylesSet.getFormatForState(state); + if(oldFormat !== null) { - format.removeEventListener(Event.CHANGE, changeHandler); + oldFormat.removeEventListener(Event.CHANGE, changeHandler); } this._fontStylesSet.setFormatForState(state, format); if(format !== null) @@ -1754,9 +1755,10 @@ package feathers.controls { processStyleRestriction(key); } - if(format !== null) + var oldFormat:TextFormat = this._promptFontStylesSet.getFormatForState(state); + if(oldFormat !== null) { - format.removeEventListener(Event.CHANGE, changeHandler); + oldFormat.removeEventListener(Event.CHANGE, changeHandler); } this._promptFontStylesSet.setFormatForState(state, format); if(format !== null) diff --git a/source/feathers/controls/TextInput.as b/source/feathers/controls/TextInput.as index deb38defa..0bfd0ebe2 100644 --- a/source/feathers/controls/TextInput.as +++ b/source/feathers/controls/TextInput.as @@ -2597,9 +2597,10 @@ package feathers.controls { processStyleRestriction(key); } - if(format !== null) + var oldFormat:TextFormat = this._fontStylesSet.getFormatForState(state); + if(oldFormat !== null) { - format.removeEventListener(Event.CHANGE, changeHandler); + oldFormat.removeEventListener(Event.CHANGE, changeHandler); } this._fontStylesSet.setFormatForState(state, format); if(format !== null) @@ -2656,9 +2657,10 @@ package feathers.controls { processStyleRestriction(key); } - if(format !== null) + var oldFormat:TextFormat = this._promptFontStylesSet.getFormatForState(state); + if(oldFormat !== null) { - format.removeEventListener(Event.CHANGE, changeHandler); + oldFormat.removeEventListener(Event.CHANGE, changeHandler); } this._promptFontStylesSet.setFormatForState(state, format); if(format !== null) diff --git a/source/feathers/controls/ToggleSwitch.as b/source/feathers/controls/ToggleSwitch.as index b23e4d564..561f91943 100644 --- a/source/feathers/controls/ToggleSwitch.as +++ b/source/feathers/controls/ToggleSwitch.as @@ -2469,9 +2469,10 @@ package feathers.controls { processStyleRestriction(key); } - if(format !== null) + var oldFormat:TextFormat = this._onLabelFontStylesSet.getFormatForState(state); + if(oldFormat !== null) { - format.removeEventListener(Event.CHANGE, changeHandler); + oldFormat.removeEventListener(Event.CHANGE, changeHandler); } this._onLabelFontStylesSet.setFormatForState(state, format); if(format !== null) @@ -2528,9 +2529,10 @@ package feathers.controls { processStyleRestriction(key); } - if(format !== null) + var oldFormat:TextFormat = this._offLabelFontStylesSet.getFormatForState(state); + if(oldFormat !== null) { - format.removeEventListener(Event.CHANGE, changeHandler); + oldFormat.removeEventListener(Event.CHANGE, changeHandler); } this._offLabelFontStylesSet.setFormatForState(state, format); if(format !== null)