Skip to main content
BrBarry_SDB
Inspiring
March 24, 2022
Question

Help with Multiple action in scrip on button click

  • March 24, 2022
  • 1 reply
  • 710 views

G'Day

 

First, is it possible? Then How?

 

I have a multi layer button page for a school LMS (too many button for the one page). There are a couple buttons that open a subcategory of buttons in an overlay fashion, with a block-out button layer as to 'hide' the main button layout below (clickable to return to main layout). This work fine.

 

However, what I want to do is, when click on one of these overlay buttons, besides opening the associated link(s). I what the animation to also return to the main layout (gotoAndPlay(1)).

 

I have tried adding/include this line to the end of each function, and also tried to add the whole goto function into the link function, and neither (and other methods) are working.

 

So I need help with writing/modifying the 'ClickToGoToWebPage' + 'gotoAndPlay(1)' to work with one button click.

 

Many thanks in advance.

Br Barry.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
March 25, 2022

function f(){

this.whatever.gotoAndPlay(1);  // this is the 2nd frame, and assumes "this" is defined here

window.open("http://www.adobe.com", "_blank");

}

BrBarry_SDB
Inspiring
March 26, 2022

Now, I didn't think of that, switching the function order.

So now it works.

 

Thanks.

 

this.EdHQ_btn.addEventListener("click", fl_ClickToGoToAndPlayFromFrame_10.bind(this));
function fl_ClickToGoToAndPlayFromFrame_10() {
	this.gotoAndPlay(1);
	window.open("https://educationhq.com/news-home/", "_blank");
}

 

Br Barry.I'm Dyslexic, please just live with my grammar.
kglad
Community Expert
Community Expert
March 26, 2022

you're welcome.