Targeting HTML5 - MouseEvent problems

Hello! when I target html5 MouseEvent wont trigger… Here:

package main;

import flash.display.*;
import haxe.Timer;
import openfl.Assets;
import openfl.display.*;
import openfl.Lib;
import openfl.system.*;
import openfl.ui.*;

class Main extends Sprite 
    public var button_mc = Assets.getMovieClip("library:maingallery_mc");
    public function new() 
        button_mc.addEventListener(MouseEvent.MOUSE_DOWN, button_mc_listener);
    public function button_mc_listener(event:MouseEvent)

It adds the button_mc properly but nothing happens when I click it :confused: What am I doing wrong?

I think it is hard to tell without testing the exact SWF you are using, is it a SimpleButton or a MovieClip?

Try importing* rather than*

It is Movieclip, but I’ve also tried Button before I posted about this. Neither of 'em work.

Tried, didn’t work.

Tested it now with button_mc.visible = false; that worked at least.

New to Haxe&Openfl so I have no idea if button_mc.nextFrame(); is even supposed to work when targeting HTML5…

It should, but I think the SWF library behaves better when you are animating symbols, rather than having different shapes on multiple keyframes. I’m not sure how your SWF is constructed, but I can say that the SWF library is not perfect, but I’ve used it successfully on multiple complex projects