Skip to main content
BrBarry_SDB
Inspiring
Mar 24, 2022 10:24 PM UTC
Question

Help with Multiple action in scrip on button click

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 is closed to new replies. Start a new post to keep the conversation going.

9 replies

kglad
Community Expert
Community Expert
Mar 25, 2022 3:07 PM UTC

function f(){

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

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

}

Translate
BrBarry_SDB
Inspiring
Mar 26, 2022 6:29 AM UTC

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");
}

 

Translate
Br Barry.I'm Dyslexic, please just live with my grammar.
kglad
Community Expert
Community Expert
Mar 26, 2022 2:54 PM UTC

you're welcome.

Translate