ActivePresenter Saola Animate Pricing Download

Call functions externally

Is it possible to access the functions I’ve created from the browser console?

I know I can do something like AtomiSaola.topDocs[0].getElement() to use your functions but couldn’t find the functions I’ve created.

Cheers

Hi Mackavi,

You can use doc.getFunction('your-function-name'), for example:

var myFunction = AtomiSaola.topDocs[0].getFunction('myFunction');
if (myFunction)
  myFunction(/*arguments*/);

Regards

Brilliant that does the trick.

doc is undefined?
I want to embed the webpage generated by saola animate into another program, the program can call functions in saola, what should I do

fg

223
I am a newbie in coding, can you provide an example? For example: define a function in the head html, the function calls the function in the saola animate program.please…thanks.
Because I know how to call the function in html, but I don’t know how to call the function in the program

Hi wei_xie,

It’s likely that you define your function with a doc parameter but you don’t pass a value for this parameter when calling the function.

var doc = AtomiSaola.topDocs[0];
var myFunction = doc.getFunction('myFunction');
if (myFunction)
  myFunction(doc); // if your function declaration is function myFunction(doc) {...}

Regards

It works good,thanks,Can I define function calls in the head html? The program I want to embed allows me to communicate with the functions in the head html. I am a novice, which is really difficult for me.I want to use the saola animate to make a responsive UI for my program.Where should I write your code to complete the communication between the two?

I’m not sure what the two you want them to communicate is, can you please be specific?

Regards

I want to use saola animate to make ue4 UI. Now I know how to pass the click event in the saola animate to UE4, but I don’t know how to pass the UE4 event to the saola animate.
I don’t know if this is allowed。

I will use saola animate as a UI tool for UE4 and verge 3d,
saola animation is cool。

Hi,

Do you embed your UE4 or Verge 3d content through a HTML Widget?
If so, you can do as follows to communicate between Saola Animate and your content:

// get JavaScript window and document object of your content from Saola Animate
// and call your content public functions from them ....
var frameNode = doc.getElement('your HTML Widget name').embeddedDom;
var embeddedWindow = frameNode.contentWindow;
var embeddedDocument = frameNode.contentDocument;

// get Saola Animate document from your content and call Saola Animate functions
var SaolaDoc = window.parent.AtomiSaola.topDocs[0];

Regards

No, I embed the page made by saola into UE4, and the two can interact.
Describe it in another way, can I write a function in the head html to call the function I created in the program.
For example, I wrote a click button in the head html and a function play timeline in the program. Can I click this button in the head html to trigger the function to play the timeline? (Because I know how to use UE4 to call the functions in the head html of the saola animate. If the above functions can be realized, ue4 can call the functions in the program),I have written the following code in the head html, but it is incorrect:

ue.interface.uefunction = testfunction(){
var doc = AtomiSaola.topDocs[0];
var myFunction = doc.getFunction('myFunction');
if (myFunction)
  myFunction(doc);
}

it works well with the following code:

ue.interface.uefunction = testfunction(){
 alert("Hello! test");
}

Also, thank you for your quick reply.

Hi,

Do you embed Saola Animate HTML5 into your UE4 page directly or via an iframe?
If you embed it via an iframe, you must get AtomiSaola object from the iframe element:

// suppose Saola Animate HTML5 is embedded into the first iframe
// (you can use other methods to get the iframe, e.g. document.getElementById('iframe id')
var iframe = frames[0];
var Saola = iframe.AtomiSaola;
var saolaDoc = Saola.topDocs[0];
// call Saola Animate functions from saolaDoc...

Please note that both your UE4 page and Saola Animate HTML5 must be hosted on the same domain, otherwise you need to configure your server where you host Saola Animate HTML5 to allow it to be accessed by your UE4 page.

Regards

Can you help me see my code?
test file.saolapack (2.5 KB)

Hi,

var myFunction = doc.getFunction('myFunction');

Your function name is 'myfunction', not 'myFunction'. It’s case sensitive.

Regards