From 6bb0b50186fdf0dfc6361a1f8446f38c6c353461 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Wed, 28 Feb 2007 03:02:54 +0000 Subject: [PATCH] Another use for ValueEvent. Should be compatible with old listeners. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4608 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/util/MediaContainer.as | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/as/com/threerings/util/MediaContainer.as b/src/as/com/threerings/util/MediaContainer.as index 1b2593d42..0ae01555e 100644 --- a/src/as/com/threerings/util/MediaContainer.as +++ b/src/as/com/threerings/util/MediaContainer.as @@ -63,7 +63,8 @@ import com.threerings.media.image.ImageUtil; */ public class MediaContainer extends Sprite { - /** An event we dispatch when our size is known. */ + /** A ValueEvent we dispatch when our size is known. + * Value: [ width, height ]. */ public static const SIZE_KNOWN :String = "mediaSizeKnown"; /** A log instance that can be shared by sprites. */ @@ -461,13 +462,9 @@ public class MediaContainer extends Sprite if (_w != ww || _h != hh) { _w = ww; _h = hh; - // TODO: I think that I'll want to create a subclass of the - // basic media container which does things that are usefulish - // but separate from MsoySprite. SIZE_KNOWN is one of those - // things that should probably be moved. Maybe BaseMediaContainer - // and MediaContainer? FancyMediaContainer? - dispatchEvent(new Event(SIZE_KNOWN)); contentDimensionsUpdated(); + // dispatch an event to any listeners + dispatchEvent(new ValueEvent(SIZE_KNOWN, [ ww, hh ])); } }