Callback in Javascript

Problem:
Hi,
In javascript I would like to show an object and let it dissappear by zoom out after 500 ms. The information in the Manual is cyptic for me:

“options: AP.EffectDirection or {
direction: AP.EffectDirection,
callback: Optional callback called when effect completes, callback is bound to the object (‘this’ is the object).”

I can let the object appear (with an effect of my choosing) but I do not know how to make it dissappear. Could you please provide me with an example of that? Would it be possible to include an example in the manual for the next iteration …?

Thanks a lot,
Rolf

ActivePresenter version:

OS:

Notes:

Hi Rolf,

“callback” is the function will be executed when the effect completes.
So you can use “callback” option to hide the object:

prez.object('object name').show(AP.EffectType.ZOOM_IN, 500, {
  callback: function() {
    // this is the object
    this.hide();
  }
});

We’ll consider adding some examples in the user manual in future releases.

Regards

1 Like