Fill same textbox with different texts through JS

Problem:
Hi,
I would like to create a cartoon-like scenario where two persons have a conversation through speech bubbles.
Instead of creating 20 or more different shapes with individual utterancnes I wonder if it was possible to just have two speech-bubble shapes which shows different utterances, which are stored as strings in two arrays, one for person A and one for B.
For example:
A[0] = “How are you?”
B[0] = “Good! What are you up to?”
A[1] = “Meeting a friend. Joe, do you know him?”
B[1] = “Oh yes, he’s great”

A = {“How are you?”, “Meeting a friend. Joe, do you know him?”, …} and so on.

I would then just change the utterances through JS.

Thanks for any help,
Rolf

ActivePresenter version:

OS:

Notes:

Hi Rolf,

For your concern, you can achieve this by using the text(plainText) or html(htmlText) function of the object.
You can clarify your request further so we can better assist you.
For example, would you like to change text following events (clicking an object) or following time in the Timeline pane?

Best regards,
Quynh Anh

Thanks, Quynh Anh, excellent.
And yes, it would be after a click event.
Best, Rolf

Hi Rolf,

Here is a sample for your request.
You can take a look at the scripts in the Interactivity tab > Slide On Load and Button_6 On Click.
conversation.approj (224 KB)

Let us know if it works for you.

Kind regards,
Quynh Anh

1 Like

Thanks, Quynh Anh, exactly what was was looking for!!!
Best, Rolf

Hi Rolf,

I’m glad that it helps resolve your concern.
Let us know if you encounter any other issues in the future.

Kind regards,
Quynh Anh