- Don't actually set our width/height to that of the media we contain.
That's so "Java" of me, in actionscript children regularly have larger bounds than their parents (and get to display it all). - Stronger security restrictions on loaded content. (Games will break) - A few visits from old man Occam. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4439 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -180,8 +180,7 @@ public class MediaContainer extends Box
|
|||||||
if (h == -1) {
|
if (h == -1) {
|
||||||
h = 100;
|
h = 100;
|
||||||
}
|
}
|
||||||
_media = ImageUtil.createErrorImage(w, h);
|
setMediaObject(ImageUtil.createErrorImage(w, h));
|
||||||
rawChildren.addChild(_media);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -261,8 +260,6 @@ public class MediaContainer extends Box
|
|||||||
_w = 0;
|
_w = 0;
|
||||||
_h = 0;
|
_h = 0;
|
||||||
_media = null;
|
_media = null;
|
||||||
width = NaN;
|
|
||||||
height = NaN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -320,9 +317,12 @@ public class MediaContainer extends Box
|
|||||||
protected function getContext (url :String) :LoaderContext
|
protected function getContext (url :String) :LoaderContext
|
||||||
{
|
{
|
||||||
// We allow content to share but not overwrite our classes
|
// We allow content to share but not overwrite our classes
|
||||||
return new LoaderContext(true,
|
// return new LoaderContext(true,
|
||||||
new ApplicationDomain(ApplicationDomain.currentDomain),
|
// new ApplicationDomain(ApplicationDomain.currentDomain),
|
||||||
SecurityDomain.currentDomain);
|
// SecurityDomain.currentDomain);
|
||||||
|
|
||||||
|
// share nothing, trust nothing
|
||||||
|
return new LoaderContext(false, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -340,15 +340,6 @@ public class MediaContainer extends Box
|
|||||||
*/
|
*/
|
||||||
protected function loadError (event :IOErrorEvent) :void
|
protected function loadError (event :IOErrorEvent) :void
|
||||||
{
|
{
|
||||||
var info :LoaderInfo = (event.target as LoaderInfo);
|
|
||||||
removeListeners(info);
|
|
||||||
|
|
||||||
var loader :Loader = (_media as Loader);
|
|
||||||
rawChildren.removeChild(loader);
|
|
||||||
if (loader.mask != null) {
|
|
||||||
rawChildren.removeChild(loader.mask);
|
|
||||||
}
|
|
||||||
|
|
||||||
setupBrokenImage(-1, -1);
|
setupBrokenImage(-1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -447,9 +438,6 @@ public class MediaContainer extends Box
|
|||||||
*/
|
*/
|
||||||
protected function updateContentDimensions (ww :int, hh :int) :void
|
protected function updateContentDimensions (ww :int, hh :int) :void
|
||||||
{
|
{
|
||||||
width = ww;
|
|
||||||
height = hh;
|
|
||||||
|
|
||||||
// update our saved size, and possibly notify our container
|
// update our saved size, and possibly notify our container
|
||||||
if (_w != ww || _h != hh) {
|
if (_w != ww || _h != hh) {
|
||||||
_w = ww;
|
_w = ww;
|
||||||
|
|||||||
Reference in New Issue
Block a user