From 8fa045f6deb1e5c7337b6f37c844211c123b1a22 Mon Sep 17 00:00:00 2001 From: Moxie <124418090+moxie-coder@users.noreply.github.com> Date: Mon, 12 Feb 2024 20:57:25 -0500 Subject: [PATCH] Update FlxAnim.hx --- source/flxanimate/animate/FlxAnim.hx | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/source/flxanimate/animate/FlxAnim.hx b/source/flxanimate/animate/FlxAnim.hx index d3006938..c55c863d 100644 --- a/source/flxanimate/animate/FlxAnim.hx +++ b/source/flxanimate/animate/FlxAnim.hx @@ -52,7 +52,6 @@ class FlxAnim implements IFlxDestroyable * When ever the animation is playing. */ public var isPlaying(default, null):Bool; - public var callback:(name:String, frameNumber:Int) -> Void; public var onComplete:()->Void; @@ -190,12 +189,8 @@ class FlxAnim implements IFlxDestroyable while (_tick > frameDelay) { (reversed) ? curFrame-- : curFrame++; + curSymbol.fireCallbacks(curFrame); _tick -= frameDelay; - - @:privateAccess - curSymbol._shootCallback = true; - - fireCallback(); } if (finished || curFrame == (reversed ? 0 : curSymbol.length - 1)) @@ -455,16 +450,6 @@ class FlxAnim implements IFlxDestroyable return symbolDictionary.get(curInstance.symbol.name); } - inline function fireCallback():Void - { - if (callback != null) - { - var name:String = (curSymbol != null) ? curSymbol.name : null; - callback(name, curFrame); - } - - } - public function destroy() { isPlaying = false; @@ -473,10 +458,12 @@ class FlxAnim implements IFlxDestroyable _tick = 0; buttonMap = null; animsMap = null; - callback = null; - curInstance = FlxDestroyUtil.destroy(curInstance); - stageInstance = FlxDestroyUtil.destroy(stageInstance); - metadata = FlxDestroyUtil.destroy(metadata); + curInstance.destroy(); + curInstance = null; + stageInstance.destroy(); + stageInstance = null; + metadata.destroy(); + metadata = null; swfRender = false; _parent = null; symbolDictionary = null;