Skip to main content
Brian_Raila
Inspiring
Feb 20, 2020 10:51 AM UTC
Question

Using setTimeOut, delay a callAS "multimedia_play"

Here is my ongoing quest -- recently SOLVED, up to the point of delaying display of an Alert, by using setTimeOut.  Now I seek to achieve delaying display of an RMA, similarly.

 

Here's where I need help.  My comprehension of ActionScript is still vague.  I have been able to, in a scrpt,   Play an RMA, by using an rm.callAS operation.  This works, as seen with 'First Clip' on the left side of attached document:

 

var aRM = this.getAnnotsRichMedia(0); // var used to ID any Clip on first page (PDF document page# minus 1)
//
var rm = aRM[0]; // get rich media annot for First Clip [RM List Position# minus 1]
//
if ( !rm.activated ) rm.activated=true; // activate the Clip-annot 
rm.callAS("multimedia_play"); // play First Clip, right away

 

 

 

The 'Second Clip', on the right side, is to play, following a 2.0 sec. delay:

 

var aRM = this.getAnnotsRichMedia(0); // var used to ID any Clip on first page (PDF document page# minus 1)
//
var rm = aRM[1]; // get rich media annot for Second Clip [RM List Position# minus 1]
//
if ( !rm.activated ) rm.activated=true; // activate the Clip-annot 
//
app.setTimeOut (rm.callAS("multimedia_play"), 2000 );  // Play Second Clip, after 2000 milliseconds

 

 

 

I can well imagine problems exist in my comingling of app.Methods, and callAS commands.

 

Comentary appreciated.

 

This topic is closed to new replies. Start a new post to keep the conversation going.

4 replies

Bernd Alheit
Community Expert
Community Expert
Feb 20, 2020 1:59 PM UTC

Use this:

app.setTimeOut ('rm.callAS("multimedia_play")', 2000 );

Translate
Brian_Raila
Inspiring
Feb 20, 2020 6:09 PM UTC

I revised, as Bernd suggested.  No change.

 

Also, I've tried to update threads by attaching revised document to a Repy/update [as attached to this Reply].  The attachment seems to upload, but it's not apparent that Forum users can see it.

 

Translate
try67
Community Expert
Community Expert
Feb 20, 2020 12:22 PM UTC

Thom Parker already replied in your other thread and correctly mentioned that the first parameter of the setTimeOut method needs to be a string, and it needs to contain your full code. It can reference variables that were declared earlier (if done at the same or a higher scope), but it's better to place all of your code in this parameter. Alternatively, you can place the code in a function and then just call that function, but it still needs to be in the form of a string.

Translate
try67
Community Expert
Community Expert
Feb 20, 2020 1:39 PM UTC

Surprisingly, your code does work... So I'm not sure what the issue is.

Translate