3 Replies Latest reply on Sep 29, 2016 3:47 PM by pauland

    Animate CC IOS project stop device from sleeping

    pauland Level 4

      I have an Animate CC project for IOS using AS3.


      The app works fine, but there is a video section which is rather long, so with no interaction the device falls asleep, and when the app is reselected it starts from the beginning.


      I can stop it from falling asleep in the equivalent version for Android, but the IOS version is stubborn.


      What have I forgotten to do?


      This is what I have right now (see below). Are there some permissions required in the build too (like Android)?






      import flash.desktop.NativeApplication;


      import flash.desktop.SystemIdleMode;




      stage.addEventListener(Event.ACTIVATE, fl_Activate);


      stage.addEventListener(Event.DEACTIVATE, fl_Deactivate);




      function fl_Activate(event:Event=null):void {


           NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;






      function fl_Deactivate(event:Event):void {


           NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.NORMAL;