OnEnterFrame only triggering for first instance of Assets.getMovieClip

The current issue behaves correctly when targeting “flash”, but behaves as described for “macos”, “html” build options


import openfl.display.MovieClip;
import openfl.display.Sprite;
import openfl.utils.ByteArray;
import openfl.Assets;

class Main extends Sprite {
	private var clip:MovieClip;
	public function new () {
		super ();

		for (i in 0...30)
			var angelClip = Assets.getMovieClip ("AngelWalk:AngelTopWalking");
			// position in nice, 5x6 grid
			angelClip.x = (i % 5) * 200;
			angelClip.y = (Math.floor(i/5) * 200);
			angelClip.addEventListener (Event.ENTER_FRAME, angel_onEnterFrame);
			addChild( angelClip );

	private function angel_onEnterFrame( event: Event):Void {
		var angel = cast (, MovieClip);
		angel.alpha = Math.random();

In the above code clip, 30 angels are positioned in a grid, however, the angel_onEnterFrame callback only seems to be called for the top left angel (who’d be at created first, at i = 0)

Maybe, it might actually have something to do with the cast I’m doing! I noticed if i set the “name” of each clip it correctly retains the name in trace statements, whereas, the name will be “instance1” in the event handler after the “cast” call.

Been reading some other stuff and it seems to be the Dynamic issue that’s been mentioned elsewhere with