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

Idle mode sceensaver time out for desktop web app

Community Beginner ,
Jun 07, 2022 Jun 07, 2022

Copy link to clipboard

Copied

I'm building an interactive desktop web app with different menus and videos that will be accessed via URL and presented on a large format touchscreen. I have a startup screen that is a movieclip symbol with some animation - user taps screen to flick through the interactive app. I need help creating a timeout code to return the app to the initial state after 2 minutes of inactivity (no touch/mouse movement or gestures).

 

I did find in discussions code that works but it seems to only work for Air Apps and not desktop. Any help would be much appreciated as I'm relatively new to code.

https://community.adobe.com/t5/animate-discussions/idle-mode-sceensaver-time-out-for-android-app-int...

 

Tks

Views

117

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 ,
Jun 07, 2022 Jun 07, 2022

Copy link to clipboard

Copied

Hi.

 

Sorry for missing your question on the other topic.

 

The code for the HTML5 Canvas document could be something like this:

 

var root = this;
var delay = 5000;
var timeout = 0;

function main()
{
	root.stop();
	root.startButton.on("click", start);
	anim_container.addEventListener("mousedown", wake);
	anim_container.addEventListener("mousemove", wake);
}

function start(e)
{
	root.gotoAndStop(1);
}

function wake(e)
{
	clearTimeout(timeout);
	timeout = setTimeout(idle, delay);
}

function idle()
{
	root.gotoAndStop(0);
}

main();

 

 

I hope it helps.

 

Regards,

JC

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 Beginner ,
Jun 07, 2022 Jun 07, 2022

Copy link to clipboard

Copied

Hi JC,

That works perfect!! Really appreaciated.

Many thanks,

M

 

 

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 ,
Jun 07, 2022 Jun 07, 2022

Copy link to clipboard

Copied

Awesome, M! You're welcome!

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 Beginner ,
Sep 05, 2022 Sep 05, 2022

Copy link to clipboard

Copied

LATEST

Hi,

 

I have added a 2 min video on Frame (70) which will play when a button is clicked from the home screen.

I'm trying to add an exception on the video frame (70) to prevent the root timer from returning to the homescreen after 1 minute. Ideally I'd also like the video to play and when finished return to home screen (0)

 

This is the code on the home screen:

var root = this;
var delay = 60000;
var timeout = 0;

function main()
{
root.stop();
root.startButton.on("click", start);
anim_container.addEventListener("mousedown", wake);
anim_container.addEventListener("mousemove", wake);
}

function start(e)
{
root.gotoAndStop(1);
}

function wake(e)
{
clearTimeout(timeout);
timeout = setTimeout(idle, delay);
}

function idle()
{
root.gotoAndStop(0);
}

main();

 

-----------------------

 

I tried this but doesn't work:


this.video.addEventListener("onend", return1);

function return1()
{
this.gotoAndStop(0);
}

 

Any help appreciated

 

M

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