From 8feb5df8684b54657009112ddb228e87305a3409 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Wed, 26 Mar 2008 03:14:15 +0000 Subject: [PATCH] Let's track SecurityError events too. Normally if things are set up well this won't happen, but it did today for folks with a cached crossdomain.xml. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@457 ed5b42cb-e716-0410-a449-f6a68f950b19 --- src/as/com/threerings/flash/MediaContainer.as | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/as/com/threerings/flash/MediaContainer.as b/src/as/com/threerings/flash/MediaContainer.as index 92b5301a..02812eb7 100644 --- a/src/as/com/threerings/flash/MediaContainer.as +++ b/src/as/com/threerings/flash/MediaContainer.as @@ -33,7 +33,7 @@ import flash.errors.IOError; import flash.events.Event; import flash.events.EventDispatcher; -import flash.events.IEventDispatcher; +import flash.events.ErrorEvent; import flash.events.IOErrorEvent; import flash.events.MouseEvent; import flash.events.NetStatusEvent; @@ -493,7 +493,8 @@ public class MediaContainer extends Sprite { info.addEventListener(Event.COMPLETE, handleComplete); info.addEventListener(Event.INIT, handleInit); - info.addEventListener(IOErrorEvent.IO_ERROR, handleIOError); + info.addEventListener(IOErrorEvent.IO_ERROR, handleError); + info.addEventListener(SecurityErrorEvent.SECURITY_ERROR, handleError); info.addEventListener(ProgressEvent.PROGRESS, handleProgress); } @@ -504,14 +505,15 @@ public class MediaContainer extends Sprite { info.removeEventListener(Event.COMPLETE, handleComplete); info.removeEventListener(Event.INIT, handleInit); - info.removeEventListener(IOErrorEvent.IO_ERROR, handleIOError); + info.removeEventListener(IOErrorEvent.IO_ERROR, handleError); + info.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, handleError); info.removeEventListener(ProgressEvent.PROGRESS, handleProgress); } /** - * A callback to receive IO_ERROR events. + * A callback to receive IO_ERROR and SECURITY_ERROR events. */ - protected function handleIOError (event :IOErrorEvent) :void + protected function handleError (event :ErrorEvent) :void { stoppedLoading(); setupBrokenImage(-1, -1);