javascripthtmlactionscript-3html5-canvasflash-cc

Converting as3 btn code to Javascript


I am attempting to convert a flash as3 file to canvas html5 doc with javascript.

How would I convert this code below?

nex.addEventListener(MouseEvent.CLICK, onClickHandler);

function onClickHandler(myEvent:MouseEvent)
{
    SoundMixer.stopAll();
    MovieClip(parent).nextFrame();
}

My javascript attempt that is now working.

this.nex.onClick = function(){

 exportRoot.play();

}

Thanks for the help!


Solution

  • Here is the proper code to use for buttons now in a html5 flash project

    this.Next.addEventListener("click", fl_ClickToGoToAndStopAtFrame_7.bind(this));
    
    function fl_ClickToGoToAndStopAtFrame_7() {
    
        this.gotoAndStop(1);
    
    }