fix assumptions about parent property
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/90d18a99 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/90d18a99 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/90d18a99 Branch: refs/heads/refactor-sprite Commit: 90d18a998ec91f8ba8d780e00cebebaee2cd764b Parents: 4ad3772 Author: Alex Harui <[email protected]> Authored: Fri Jul 29 14:28:12 2016 -0700 Committer: Alex Harui <[email protected]> Committed: Tue Aug 2 10:20:29 2016 -0700 ---------------------------------------------------------------------- .../flex/org/apache/flex/html/beads/ImageButtonView.as | 9 +++++---- .../src/main/flex/org/apache/flex/html/beads/ImageView.as | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90d18a99/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageButtonView.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageButtonView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageButtonView.as index 21f34ca..eecc607 100644 --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageButtonView.as +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageButtonView.as @@ -36,6 +36,7 @@ COMPILE::SWF { import org.apache.flex.core.IStrand; import org.apache.flex.core.ValuesManager; import org.apache.flex.events.Event; + import org.apache.flex.events.IEventDispatcher; /** * The ImageButtonView class provides an image-only view @@ -124,8 +125,8 @@ COMPILE::SWF { if (isNaN(host.explicitWidth) && isNaN(host.percentWidth)) { host.setWidth(loader.content.width); - if (host.parent) - host.parent.dispatchEvent(new org.apache.flex.events.Event("layoutNeeded")); + if (host.parent is IEventDispatcher) + IEventDispatcher(host.parent).dispatchEvent(new org.apache.flex.events.Event("layoutNeeded")); } else loader.content.width = host.width; @@ -133,8 +134,8 @@ COMPILE::SWF { if (isNaN(host.explicitHeight) && isNaN(host.percentHeight)) { host.setHeight(loader.content.height); - if (host.parent) - host.parent.dispatchEvent(new org.apache.flex.events.Event("layoutNeeded")); + if (host.parent is IEventDispatcher) + IEventDispatcher(host.parent).dispatchEvent(new org.apache.flex.events.Event("layoutNeeded")); } else loader.content.height = host.height; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90d18a99/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageView.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageView.as index a956840..c7a3b39 100644 --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageView.as +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageView.as @@ -141,8 +141,8 @@ package org.apache.flex.html.beads if (host.isWidthSizedToContent()) { host.dispatchEvent(new Event("widthChanged")); - if (host.parent) - host.parent.dispatchEvent(new Event("layoutNeeded")); + if (host.parent is IEventDispatcher) + IEventDispatcher(host.parent).dispatchEvent(new Event("layoutNeeded")); } else bitmap.width = host.width; @@ -150,8 +150,8 @@ package org.apache.flex.html.beads if (host.isHeightSizedToContent()) { host.dispatchEvent(new Event("heightChanged")); - if (host.parent) - host.parent.dispatchEvent(new Event("layoutNeeded")); + if (host.parent is IEventDispatcher) + IEventDispatcher(host.parent).dispatchEvent(new Event("layoutNeeded")); } else bitmap.height = host.height; @@ -177,7 +177,7 @@ package org.apache.flex.html.beads private function loadHandler(event:Object):void { var host:UIBase = UIBase(_strand); - host.parent.dispatchEvent(new Event("layoutNeeded")); + IEventDispatcher(host.parent).dispatchEvent(new Event("layoutNeeded")); } /**
