• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to run a javascript from actions of adobe animate html5 project?

New Here ,
Apr 02, 2023 Apr 02, 2023

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);
        }
    }
})

Views

375

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 02, 2023 Apr 02, 2023

Copy link to clipboard

Copied

you can use lamba functions in animate, if that's what you're asking.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 02, 2023 Apr 02, 2023

Copy link to clipboard

Copied

I dont know. I want to run this javascript from middle of game project.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 02, 2023 Apr 02, 2023

Copy link to clipboard

Copied

that snippet is incomplete.  at a minimum, you have to include the showrewardedvideo function

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 02, 2023 Apr 02, 2023

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>

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 02, 2023 Apr 02, 2023

Copy link to clipboard

Copied

use the global script tab in the actions panel

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 02, 2023 Apr 02, 2023

Copy link to clipboard

Copied

but how to call 

ysdk.adv.showRewardedVideo({

in the middle of a game?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 02, 2023 Apr 02, 2023

Copy link to clipboard

Copied

LATEST

just call it when needed (if it's defined in your timeline or in the global script).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines