Skip to main content
Inspiring
May 25, 2021
Answered

Is it possible to make a text or image appear for only a few seconds?

  • May 25, 2021
  • 1 reply
  • 1068 views

Hi everyone!!

 

I want to set a text (or an image) to appear on a page but for only a few seconds, after an

event takes place. But I don´t know where to start. Can you show me some directions, please?

 

Thanks a lot in advance!

This topic has been closed for replies.
Correct answer try67

Yes, it is. The way to do it is to either place them as a part of a field, or to cover them using a field.

Then you can use the setTimeOut method of the app object to show or hide that field after X amount of time.

Here's a simple example. Let's say you have text that you want to show for 5 seconds. Create a (read-only) hidden text field on top of that text with a white fill. Let's call it "CoverText1". Now, under your event you enter this code:

 

var to1 = app.setTimeOut("this.getField(\"CoverText1\").display = display.visible;", 5000);

 

This will cause the field to become visible after 5 seconds, thereby covering the underlying text beneath it.

 

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
May 25, 2021

Yes, it is. The way to do it is to either place them as a part of a field, or to cover them using a field.

Then you can use the setTimeOut method of the app object to show or hide that field after X amount of time.

Here's a simple example. Let's say you have text that you want to show for 5 seconds. Create a (read-only) hidden text field on top of that text with a white fill. Let's call it "CoverText1". Now, under your event you enter this code:

 

var to1 = app.setTimeOut("this.getField(\"CoverText1\").display = display.visible;", 5000);

 

This will cause the field to become visible after 5 seconds, thereby covering the underlying text beneath it.

 

Inspiring
May 26, 2021

Thank you very much for you reply!!

 

try67
Community Expert
Community Expert
May 26, 2021

You're welcome!

I forgot to mention that you can set that field as hidden when the file is closed, in case you want the text to be visible the next time it is opened.