Skip to main content
Known Participant
November 1, 2021
Question

Cómo validar una variable a un botón

  • November 1, 2021
  • 1 reply
  • 289 views

Cómo validar una variable a un botón para que muestre una imagen o texto y reproduzca un audio y al mismo tiempo indique que ya se escucho el audio.

    This topic has been closed for replies.

    1 reply

    Lilybiri
    Legend
    November 1, 2021

    I don't understand your question really well, and that is not due to the language.

    You cannot "attach" a variable to a button, but you can use the Success event (when clicked) of the button to trigger an action. To show a text and play an audio, you don't even need an advanced action. Create a multistate object, keep the Normal state seemingly empty by adding a shape with no fill (Alpha=0) and no stroke. Add a custom state 'State 1'to that object in which you display the text in the shape and add audio. To the button you attach the action:

      Change State  ....           and indicate the multistate object and the added state with text and audio

     

    If indeed you also want to track if that button has already been clicked and the audio has been played you will need an advanced (or shared) action and a tracking variable. You will need a two-decision action, I will label the variable v_1. Add a third state to your multistate object in which you add the message 'Audio has already been played', and label that state 'State 2' :

    First decision 'Always'

        Increment v_1

    Second decision (conditional) 'CheckIt'

        IF v_1 is greater than 1

            Change State                where you go to State 2

        ELSE

            Change State                 where you go to State 1

    Known Participant
    November 2, 2021

    excellent I will try, thank you very much, Lilybiri

    Lilybiri
    Legend
    November 2, 2021

    Hope it works, let me know!