An UNLOAD event is not dispatched on any LoaderInfo for which INIT
has not already been dispatched. This is a pain in my ass. Make MediaContainer dispatch UNLOAD when it unloads its business, regardless of whether things have been initialized. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@458 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -76,6 +76,13 @@ import com.threerings.util.Util;
|
||||
*/
|
||||
[Event(name="init", type="flash.events.Event")]
|
||||
|
||||
/**
|
||||
* Dispatched when we've unloaded our content... always. The LoaderInfo's UNLOAD event
|
||||
* is only dispatched if the INIT event has already been dispatched and not if you cancel a
|
||||
* load before it INIT.
|
||||
*/
|
||||
[Event(name="unload", type="flash.events.Event")]
|
||||
|
||||
/**
|
||||
* A wrapper class for all media that will be placed on the screen.
|
||||
* Subject to change.
|
||||
@@ -299,6 +306,7 @@ public class MediaContainer extends Sprite
|
||||
// ignore
|
||||
}
|
||||
loader.unload();
|
||||
dispatchEvent(new Event(Event.UNLOAD));
|
||||
|
||||
removeChild(loader);
|
||||
var extra :String = (url == _url) ? "" : (", _url=" + _url);
|
||||
|
||||
Reference in New Issue
Block a user