frameswitcher: added onhide

This commit is contained in:
2014-07-24 18:06:54 +04:00
parent bdced9a809
commit d1491d1bd7

View File

@@ -18,6 +18,8 @@ class FrameSwitcher extends GroupView implements IFrameSwitcher<Sprite> {
public function change(id:String):IView<Dynamic> { public function change(id:String):IView<Dynamic> {
if (current != null) { if (current != null) {
if (current.id == id) return current; if (current.id == id) return current;
var onHideethod:Dynamic = Reflect.field(current, "onHide");
if (onHideethod != null) Reflect.callMethod(current, onHideethod, []);
removeView(current); removeView(current);
} }
current = frames.get(id); current = frames.get(id);