SHARE
TWEET

Untitled

a guest Sep 16th, 2019 198 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import flash.events.MouseEvent;
  2. import flash.events.Event;
  3. import flash.events.KeyboardEvent;
  4. import flash.media.Sound;
  5. import flash.media.SoundChannel;
  6. import flash.media.SoundTransform;
  7.  
  8. GDPR_Menu.visible = false;
  9.  
  10. import co.enhance.Enhance;
  11. import flash.net.SharedObject;
  12.  
  13.  
  14. var saveDataObject: SharedObject = SharedObject.getLocal("MissangestFantasyGDPR");
  15. var startAds: Boolean;
  16. var isBannerShown: Boolean;
  17. var GDPRRequired: Boolean;
  18.  
  19. privacyPolicyInGame_Btn.addEventListener(MouseEvent.CLICK, PrivacyPolicy_fnc);
  20. function PrivacyPolicy_fnc(evt: MouseEvent): void {
  21.     if (GDPRRequired) {
  22.         GDPR_Menu.visible = true;
  23.     }
  24.     if (!GDPRRequired) {
  25.         var request: URLRequest = new URLRequest("https://www.missangestgames.com/privacy-policy-apps/");
  26.  
  27.         navigateToURL(request, "_blank");
  28.     }
  29. }
  30.  
  31. //--GDPR--//
  32. checkSavedConsent();
  33.  
  34. function checkSavedConsent(): void {
  35.     if (saveDataObject.data.consentPicked == null) {
  36.         Enhance.requiresDataConsentOptIn(ConsentNeeded, ConsentNotNeeded);
  37.  
  38.         //ConsentNotNeeded();
  39.     } else {
  40.         GDPRRequired = true;
  41.         if (saveDataObject.data.consentPicked == 0) {
  42.             startAds = false;
  43.             isBannerShown = false;
  44.         } else if (saveDataObject.data.consentPicked == 1) {
  45.             startAds = true;
  46.         }
  47.     }
  48. }
  49.  
  50. Playgame1.addEventListener(MouseEvent.CLICK, Playgame1Click);
  51. function Playgame1Click(e: MouseEvent): void {
  52.     if (saveDataObject.data.consentPicked == 0) {
  53.         Playgame1function();
  54.     } else {
  55.         ShowInterstitial();
  56.         Playgame1function();
  57.     }
  58. }
  59.  
  60. Playgame2.addEventListener(MouseEvent.CLICK, Playgame2Click);
  61. function Playgame2Click(e: MouseEvent): void {
  62.     if (saveDataObject.data.consentPicked == 0) {
  63.         Playgame2function();
  64.     } else {
  65.         ShowInterstitial();
  66.         Playgame2function();
  67.     }
  68. }
  69.  
  70. Playgame3.addEventListener(MouseEvent.CLICK, Playgame3Click);
  71. function Playgame3Click(e: MouseEvent): void {
  72.     if (saveDataObject.data.consentPicked == 0) {
  73.         Playgame3function();
  74.     } else {
  75.         ShowInterstitial();
  76.         Playgame3function();
  77.     }
  78. }
  79.  
  80. Playgame4.addEventListener(MouseEvent.CLICK, Playgame4Click);
  81. function Playgame4Click(e: MouseEvent): void {
  82.     if (saveDataObject.data.consentPicked == 0) {
  83.         Playgame4function();
  84.     } else {
  85.         ShowInterstitial();
  86.         Playgame4function();
  87.     }
  88. }
  89.  
  90. Playgame5.addEventListener(MouseEvent.CLICK, Playgame5Click);
  91. function Playgame5Click(e: MouseEvent): void {
  92.     if (saveDataObject.data.consentPicked == 0) {
  93.         Playgame5function();
  94.     } else {
  95.         ShowInterstitial();
  96.         Playgame5function();
  97.     }
  98. }
  99.  
  100. function ConsentNeeded(): void {
  101.     startAds = false;
  102.     ShowGDPRMenu();
  103.     GDPRRequired = true;
  104. }
  105.  
  106. function ConsentNotNeeded(): void {
  107.     startAds = true;
  108.     HideGDPRMenu();
  109.     GDPRRequired = false;
  110. }
  111.  
  112. function ShowGDPRMenu(): void {
  113.     GDPR_Menu.visible = true;
  114. }
  115.  
  116. function HideGDPRMenu(): void {
  117.     GDPR_Menu.visible = false;
  118. }
  119.  
  120. GDPR_Menu.optIn_Btn.addEventListener(MouseEvent.CLICK, onGDPROptInClicked);
  121. function onGDPROptInClicked(e: MouseEvent): void {
  122.     Enhance.serviceTermsOptIn();
  123.     startAds = true;
  124.     saveDataObject.data.consentPicked = 1;
  125.     GDPR_Menu.visible = false;
  126. }
  127.  
  128. GDPR_Menu.optOut_Btn.addEventListener(MouseEvent.CLICK, onGDPROptOutClicked);
  129. function onGDPROptOutClicked(e: MouseEvent): void {
  130.     Enhance.serviceTermsOptOut();
  131.     startAds = false;
  132.     saveDataObject.data.consentPicked = 0;
  133.     GDPR_Menu.visible = false;
  134.  
  135.     Enhance.hideBannerAd();
  136.     isBannerShown = false;
  137. }
  138.  
  139. GDPR_Menu.privacyPolicy_Btn.addEventListener(MouseEvent.CLICK, GDPRPrivacyPolicy_fnc);
  140. function GDPRPrivacyPolicy_fnc(evt: MouseEvent): void {
  141.     var request: URLRequest = new URLRequest("https://www.missangestgames.com/privacy-policy-apps/");
  142.  
  143.     navigateToURL(request, "_blank");
  144. }
  145.  
  146. //--ADS--//
  147.  
  148. var cdDecBanner: Number = 1;
  149. var tsBanner: Number = 2;
  150. var cdsBanner = tsBanner;
  151. var BannerAdTimer: Timer = new Timer(cdDecBanner * 1000);
  152.  
  153. function callBanner_fnc() {
  154.     if (startAds) {
  155.         if (Enhance.isBannerAdReady()) {
  156.             Enhance.showBannerAdWithPosition(Enhance.POSITION_TOP);
  157.             isBannerShown = true;
  158.         } else {
  159.             trace("Banner Not Ready");
  160.             tsBanner = 2;
  161.             cdsBanner = tsBanner;
  162.             tsBanner;
  163.             BannerAdTimer.start();
  164.             BannerAdTimer.addEventListener(TimerEvent.TIMER, BannerAdTick);
  165.         }
  166.     } else {
  167.         return;
  168.     }
  169. }
  170. function BannerAdTick(evt: TimerEvent): void {
  171.     if (cdsBanner == 0) {
  172.         tsBanner = 2;
  173.         cdsBanner = tsBanner;
  174.         tsBanner;
  175.         BannerAdTimer.stop();
  176.         BannerAdTimer.removeEventListener(TimerEvent.TIMER, BannerAdTick);
  177.  
  178.         callBanner_fnc();
  179.  
  180.     } else {
  181.         cdsBanner = cdsBanner - cdDecBanner;
  182.         cdsBanner;
  183.     }
  184. }
  185.  
  186.  
  187. var cdDec: Number = 1;
  188. var ts: Number = 2;
  189. var cds = ts;
  190. var adTimer: Timer = new Timer(cdDec * 200);
  191.  
  192. function ShowInterstitial(): void {
  193.     if (startAds) {
  194.         if (Enhance.isInterstitialReady()) {
  195.             Enhance.showInterstitialAd();
  196.             callBanner_fnc();
  197.         } else {
  198.             trace("Inters Not Ready");
  199.             ts = 2;
  200.             cds = ts;
  201.             ts;
  202.             adTimer.start();
  203.             adTimer.addEventListener(TimerEvent.TIMER, adTick);
  204.         }
  205.     } else {
  206.         return;
  207.     }
  208. }
  209.  
  210.  
  211. function adTick(evt: TimerEvent): void {
  212.     if (cds == 0) {
  213.         ts = 2;
  214.         cds = ts;
  215.         ts;
  216.         adTimer.stop();
  217.         adTimer.removeEventListener(TimerEvent.TIMER, adTick);
  218.  
  219.         ShowInterstitial();
  220.  
  221.     } else {
  222.         cds = cds - cdDec;
  223.         cds;
  224.     }
  225. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top