Nested MovieClips HTML5


I am new to this board so please forgive me if I missed a topic replying to my question.
I am trying to use a swf library in a project and I managed to import successfully and also instantiate an exported MovieClip from that.

Now, that MovieCip has two nested MovieClips that can be easily used as instances of their parent.

Each one of them has also a nested MovieClip and I am trying to use it by its instance name but I get an error in Chrome devtools that the object is undefined.

All movieclips are exported in the swf > as3 > frame1 and I can see them in HaxeDevelop assets > swf

The same thing works great if I choose swf compile.

So, to explain better I have this code:

var snd = new Music();;

which works fine in flash but not in html

If I change to

var snd = new Music();

cast(“msmc”), MovieClip).gotoAndStop(2);
cast(snd.fx.getChildByName(“fxmc”), MovieClip).gotoAndStop(2);

works fine on both platforms.

This means that nesting instances work only for the first level in html5 and then I have to use children array of the MovieClip?


Haxe removed the feature we used to use to implement dynamic access this way

I was considering a couple options:

1.) Generate classes for each MovieClip in the SWF (even if “Export for ActionScript” is not checked) so we can type each child object
2.) Create some kind of DisplayObjectAccess type (or implement through Object?) to allow opt-in dynamic access using some new features available in Haxe 4

I understand that cast + getChildByName is a bit cumbersome :frowning:

EDIT: FWIW you can currently use a temp variable as well:

var msmc:MovieClip = cast"msmc");
var fxmc:MovieClip = cast snd.fx.getChildByName("fxmc");