Do not shutdown and reload if we're going to display the same URL, useful

for when this is used within another widget as a list item renderer.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4460 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-11-20 21:23:33 +00:00
parent b6d37a472a
commit d93d529ff8
@@ -80,6 +80,11 @@ public class MediaContainer extends Box
*/
public function setMedia (url :String) :void
{
if (Util.equals(_url, url)) {
return; // no change
}
_url = url;
// shutdown any previous media
if (_media != null) {
shutdown(false);
@@ -107,6 +112,7 @@ public class MediaContainer extends Box
*/
public function setMediaObject (disp :DisplayObject) :void
{
_url = null;
if (_media != null) {
shutdown(false);
}
@@ -497,6 +503,9 @@ public class MediaContainer extends Box
// nada, by default
}
/** The unaltered URL of the content we're displaying. */
protected var _url :String;
/** The unscaled width of our content. */
protected var _w :int;