Copy link to clipboard
Copied
Hello everyone. Im trying to understand how to run this java code to run ad from adobe animate actions panel. I meen there is something like a gate from run this script from actions panel of html5 adobe aniate project to this script wich i can add later to html5 page after publish from animate?
ysdk.adv.showRewardedVideo({
callbacks: {
onOpen: () => {
console.log('Video ad open.');
},
onRewarded: () => {
console.log('Rewarded!');
},
onClose: () => {
console.log('Video ad closed.');
},
onError: (e) => {
console.log('Error while open video ad:', e);
}
}
})
Copy link to clipboard
Copied
you can use lamba functions in animate, if that's what you're asking.
Copy link to clipboard
Copied
I dont know. I want to run this javascript from middle of game project.
Copy link to clipboard
Copied
that snippet is incomplete. at a minimum, you have to include the showrewardedvideo function
Copy link to clipboard
Copied
Maybe it doesnt need becausee i dont see this in official docs. There sdk included but i know how to implement it - i will include this in html5 published from animate file just before game starts. And other what i want i dont know what to do with that.
<!-- Yandex Games SDK -->
<script src="https://yandex.ru/games/sdk/v2"></script>
<script>
YaGames.init().then(ysdk => {
// ...
});
</script>
Copy link to clipboard
Copied
use the global script tab in the actions panel
Copy link to clipboard
Copied
but how to call
ysdk.adv.showRewardedVideo({
in the middle of a game?
Copy link to clipboard
Copied
just call it when needed (if it's defined in your timeline or in the global script).