Dispatch a SIZE_KNOWN event when we know our media's size.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4461 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -48,6 +48,9 @@ import com.threerings.media.image.ImageUtil;
|
|||||||
*/
|
*/
|
||||||
public class MediaContainer extends Box
|
public class MediaContainer extends Box
|
||||||
{
|
{
|
||||||
|
/** An event we dispatch when our size is known. */
|
||||||
|
public static const SIZE_KNOWN :String = "mediaSizeKnown";
|
||||||
|
|
||||||
/** A log instance that can be shared by sprites. */
|
/** A log instance that can be shared by sprites. */
|
||||||
protected static const log :Log = Log.getLog(MediaContainer);
|
protected static const log :Log = Log.getLog(MediaContainer);
|
||||||
|
|
||||||
@@ -482,6 +485,12 @@ public class MediaContainer extends Box
|
|||||||
if (_w != ww || _h != hh) {
|
if (_w != ww || _h != hh) {
|
||||||
_w = ww;
|
_w = ww;
|
||||||
_h = hh;
|
_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();
|
contentDimensionsUpdated();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user