Skip to main content
Participant
February 9, 2023
Question

Sound in HTML banner

  • February 9, 2023
  • 1 reply
  • 153 views

Hello, I need help:
I want to put a sound in the HTML5 banner, and have it play when the mouse passes over it.
I also want there to be a one-second delay before activation and also that when they click on the banner they will go to a landing page.
Thank you!

    This topic has been closed for replies.

    1 reply

    JoãoCésar17023019
    Community Expert
    Community Expert
    February 9, 2023

    Hi.

     

    Create a Button instance and put the sound in the second frame like in the following pictures:

     

    Button's timeline:

     

    Frame's sound set in the Properties panel:

     

    Sound in the Library:

     

    Then write a script like this in the timeline in which the button lives:

    this.yourSoundButton.on("click", function()
    {
        window.open("https://www.adobe.com/", "_blank");
    });

     

    About the activation delay: do you want to delay the ability or the button to receive a click or the playback of the sound? Well... In any case, you can use a timeline to delay the action in both cases.

     

    Please let us know..

     

    Regards,

    JC

     

    kglad
    Community Expert
    Community Expert
    February 9, 2023

    @JoãoCésar17023019 

     

    i'm not sure the sound button is the only click trigger:

     

    this.addEventListener("click",ff);

     

    function ff(){
    setTimeout(f,1000);
    }

     

    function f(){

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

    }