Skip to content

Commit

Permalink
Fix timelines on flash (see #32 (comment))
Browse files Browse the repository at this point in the history
  • Loading branch information
--set authored and jgranick committed Oct 23, 2024
1 parent 2689bfc commit 583ba02
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/swf/exporters/animate/AnimateSpriteSymbol.hx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AnimateSpriteSymbol extends AnimateSymbol
private function __constructor(sprite:Sprite):Void
{
var timeline = new AnimateTimeline(library, this);
if (#if (haxe_ver >= 4.2) Std.isOfType #else Std.is #end (sprite, MovieClip))
if (#if (haxe_ver >= 4.2) Std.isOfType #else Std.is #end (sprite, #if flash flash.display.MovieClip.MovieClip2 #else MovieClip #end))
{
var movieClip:MovieClip = cast sprite;
#if flash
Expand All @@ -48,10 +48,7 @@ class AnimateSpriteSymbol extends AnimateSymbol

private override function __createObject(library:AnimateLibrary):Sprite
{
#if (!macro && !flash)
Sprite.__constructor = __constructor;
#end
this.library = library;
__init(library);

#if flash
if (className == "flash.display.MovieClip")
Expand Down Expand Up @@ -107,7 +104,8 @@ class AnimateSpriteSymbol extends AnimateSymbol
#if flash
if (!#if (haxe_ver >= 4.2) Std.isOfType #else Std.is #end (sprite, flash.display.MovieClip.MovieClip2))
{
sprite.scale9Grid = scale9Grid;
MovieClip.__constructor = null;
__constructor(sprite);
}
#end

Expand All @@ -116,9 +114,12 @@ class AnimateSpriteSymbol extends AnimateSymbol

private override function __init(library:AnimateLibrary):Void
{
#if (!macro && !flash)
#if flash
MovieClip.__constructor = __constructor;
#elseif !macro
Sprite.__constructor = __constructor;
#end

this.library = library;
}

Expand Down

0 comments on commit 583ba02

Please sign in to comment.