Copy link to clipboard
Copied
Hi everyone,
I'm not really able to write codes but I really need your help in order to translate this very simple Action Script 3 code into an HTML5 one.
Thank you!
stop();
stage.addEventListener(MouseEvent.CLICK, _onStageMouseDown);
function _onStageMouseDown(e:MouseEvent):void
{
nextFrame();
}
Hi.
One way would be this:
this.stop();
stage.on("stagemousedown", onStageMouseDown);
function onStageMouseDown(e)
{
exportRoot.gotoAndStop(exportRoot.currentFrame + 1);
}
Please don't hesitate to ask if you still have any further questions.
Regards,
JC
Copy link to clipboard
Copied
Hi.
One way would be this:
this.stop();
stage.on("stagemousedown", onStageMouseDown);
function onStageMouseDown(e)
{
exportRoot.gotoAndStop(exportRoot.currentFrame + 1);
}
Please don't hesitate to ask if you still have any further questions.
Regards,
JC
Copy link to clipboard
Copied
Thank you very much Joao!
It works perfectly!!
Copy link to clipboard
Copied
B the way, do you know how would the code change when, instead of the stage, I click into a movieclip?
So that when you click inside the movieclip it goes to framenumber+1 (related to the movieclip timeline).
I tried in this manner (scena01 is the movieclip) but it does not work:
this.stop();
this.scena01.addEventListener("click", fl_ClickToGoToAndStopAtFrame_17.bind(this));
function fl_ClickToGoToAndStopAtFrame_17()
{
this.gotoAndStop(this.currentFrame + 1);
}
Copy link to clipboard
Copied
I would assume that you have to point to the actual movie clip you are targeting but I am less familiar with AS3 than canvas.
this.movieclipname.gotoAndStop(this.currentFrame + 1);