ActionScript operations -- using rm.callAS("multimedia_seek"), or any other rm.callAS
- February 21, 2020
- 2 replies
- 1157 views
I am reviewing the Adobe site - "Learning ActionScript 3", as well as many other resources. It seems I am far from fluent in ActionScript, so I turn to this Forum, as well.
I am keenly familiar with Multimedia Operations, but managed principally via the GUI-thingy [e.g. Button Properties Actions tab]. Now I seek to manage those ActionScript calls via JavaScript.
1). In the attached example file, I successfully call a pair of RMAs via rm.callAS:
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 RMA
rm.callAS("multimedia_play"); // play First Clip
//
var rm = aRM[1]; // get rich media annot for Second Clip [[RM List Position# minus 1]
//
if ( !rm.activated ) rm.activated=true; // activate the RMA
//
// IT IS DESIRED TO WAIT N MILLISECONDS BEFORE PROCEEDING, But attempts using setTimeOut have not succeeded, so here, Second Clip begins to play, in unison with First Clip
//
rm.callAS("multimedia_play"); // play Second Clip
The two clips play simultaneously.
The comment in CAPS refers to attepts made in another Forum post of mine. I've been unable to achieve a delay for the second rm.callAS.
– – –
2). Also, using a separate button in the attached example file, I aim for an RMA to seek to a timepoint, at which to begin playing the clip:
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 RMA
rm.callAS("multimedia_seek", (6)); // seek to 6.0 seconds in Second Clip
rm.callAS("multimedia_play"); // play Second Clip, beginning at 6.0 seconds
The result is most puzzling. One will note that the Seek button does in fact cause the clip to initiate playing at a timepoint after 0.0 sec., but not close to 6.0 sec.
- it is on the order of ~1.8 sec.
- it is, for each use of that button, always precisely the same timepoint [not random]
I believe when I get a grip on this, I'll be able to beneficially apply the callAS libray, much of which I'm aware.
Commentary invited.
