Skip to main content
Participating Frequently
November 20, 2015
Question

how to get a page to return to the main page after a period of inactivity on as2.0 for CS6?

  • November 20, 2015
  • 1 reply
  • 1040 views

Hi

Im doing a school project where we have to make a multiedia product on Flash Pro. I am using the lastest version CS6 and action script 2.0.

I am trying to figure out how to make a page (scene) return to the main page, which for me is a splash page, after a period of inactivity?

Btw, i do not understand a lot of the coding so can you explain it pretty much step by step

Please reply ASAP

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
November 20, 2015

var inactivityTime:10000;

var startTime:Number = 0;

this.onMouseMove=function(){

startTime=getTimer();

this.onEnterFrame=inactivityCheckF;

}

function inactivityCheckF(){

if(getTimer()-startTime>inactivityTime){

delete this.onEnterFrame;

// return to main page

}

}

Participating Frequently
November 20, 2015

thanks for that

But it still doesnt work. Okay so if the period of inactivity is 5mins and there is a scene called 'home' and i want it to return to a scene called 'splash', where do i put that information in the script?

sorry this is my first time using flash, so i have no idea on how to do anything except the basics

kglad
Community Expert
Community Expert
November 20, 2015

label the keyframe in 'splash' (eg, 'frame1_splash') and in frame 1 of your main timeline put:

var inactivityTime:300000;  // you'll probably want to decrease this for testing.

var startTime:Number = 0;

var tl:MovieClip = this;

this.onMouseMove=function(){

startTime=getTimer();

tl.onEnterFrame=inactivityCheckF;

}

function inactivityCheckF(){

if(getTimer()-startTime>inactivityTime){

delete tl.onEnterFrame;

tl.gotoAndStop('frame1_splash');

}

}