3D FlipBook - Execute callback when action happens

u***l@bvhrs.com
2022-06-13
2022-07-01

Hi, I bought the pro version and is very useful!

I need a way to call a custom callback in two different moments:

  1. when page changed (and I would need the number of the newly displayed page)
  2. when download button (also called save button) is pressed

I need to call a third-party API to log the user's behaviour. Can someone help me finding the correct way to implement it, I did not see the documentation paragraph about this.

Thank you in advance Andrea

Replies

a***r@3dflipbook.net
2022-07-01
2022-07-01

Hi, use:

$('#container').FlipBook({
  ready: function(scene) {
    scene.ctrl.addEventListener('endFlip', function() {console.log(scene.ctrl.getPageForGUI())});
    scene.view.container.find('.cmdSave').click(function() {
      console.log('Save');
    });
  }
});
u***l@bvhrs.com
2022-07-03
2022-07-03

It works, thank you so much! Is there any documentation to understand all the possibilities given from the scene object and possible listeners? I could inspect it from the console but a documentation would be nice to have

Thank you again

Log In to leave a comment