Jump to content
Search Community

Banner clickthrough fires when clicking replay button

flysi3000 test
Moderator Tag

Go to solution Solved by ohem,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I know this has an exceedingly simple answer, so apologies in advance.

 

I decided to try out Animate CC for a quickie banner campaign. I'm using Cory Hudson's awesome GSAP banner starter files (from the Greensock blog post) with AdHelper. Everything is great, except I have a play/pause toggle and every time I click on it, it fires the banner clickthrough. How do I make that not happen?

Link to comment
Share on other sites

  • Solution

I know this has an exceedingly simple answer, so apologies in advance.

 

I decided to try out Animate CC for a quickie banner campaign. I'm using Cory Hudson's awesome GSAP banner starter files (from the Greensock blog post) with AdHelper. Everything is great, except I have a play/pause toggle and every time I click on it, it fires the banner clickthrough. How do I make that not happen?

Check out my answer to the same question here: https://forums.adobe.com/thread/2147715

 

 

Edit:

 

In the case of the particular starter file you're using, the clicktag is targeting the whole stage with 

stage.on("stagemouseup", doClickthrough);

so that when you click anywhere on the stage the clickthrough fires, no matter what other buttons might be there.  

 

Removing the above code, adding an invisible button underneath your replay button that fills the whole stage, and adding this code

this.myBtn.on("click", function(evt){
  window.open(clickTag, "_blank");
});

should help, though for some reason when I test it with that particular starter file/template, I seem to have to delete  

stage.enableMouseOver();

for the clickthrough to continue working.

 

There's a lot going on in that template so I can't troubleshoot further right now, but I can tell you that the issue you were experiencing was due to the whole stage being targeted on click.

  • Like 1
Link to comment
Share on other sites

If you need to have multiple click throughs, you can also use frame scripts assigned to specific instances. In this example, genClick is the whole banner, and the android, and apple buttons, are on a layer above genClick.

 

this.apple_mc.on("click", function(evt){
window.open(clickTag, "_blank");
});

this.android_mc.on("click", function(evt){
window.open(clickTag1, "_blank");
});


this.genClick_btn.on("click", function(evt){
window.open(clickTag2, "_blank");
});
  • Like 1
Link to comment
Share on other sites

Check out my answer to the same question here: https://forums.adobe.com/thread/2147715

 

 

Edit:

 

In the case of the particular starter file you're using, the clicktag is targeting the whole stage with 

stage.on("stagemouseup", doClickthrough);

so that when you click anywhere on the stage the clickthrough fires, no matter what other buttons might be there.  

 

Removing the above code, adding an invisible button underneath your replay button that fills the whole stage, and adding this code

this.myBtn.on("click", function(evt){
  window.open(clickTag, "_blank");
});

should help, though for some reason when I test it with that particular starter file/template, I seem to have to delete  

stage.enableMouseOver();

for the clickthrough to continue working.

 

There's a lot going on in that template so I can't troubleshoot further right now, but I can tell you that the issue you were experiencing was due to the whole stage being targeted on click.

 

Yeah, that did it. Thanks so much - I got in that tunnel-vision mode that happens when everything is going smoothly, and then suddenly it isn't, and you find yourself spending an inordinate amount of time troubleshooting something that you know is supposed to be easy. (Or maybe that just happens to me...)

 

Thanks again!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...