Timer not acting does not as expected

I have a FLA file with several frames. Setting 1 is the "home page". The button takes you to the Framework 2, 3, etc.  These frameworks have video clip on them. Each video clip contains 3-4 frames of content.

I found an AS3 code to a timer that follow the movements of the mouse. Whenever the mouse is touched, the timer resets. The timer is set to return to the picture 1 (homepage) on the main timeline if the mouse is left as what for more than a certain time in the code.

This timer seems to work very well for a bit. Then it starts to get messy will more its used. Sometimes I jump to an image with a movie on it and after 1 second, it jumps back to the home page. The next time I navigate to the bottom of the timeline, he can stay on a framework for a longer period of time.

Reading through the forums I think maybe when multiple timers. I'm not sure.

At the end of the day, I want the site to sit at home page until I click on a button to go to another frame to view other clips and their content. Once I'm done browsing, I want to be a wheat to walk away from him and after awhile, I want the timeline to return to section 1 (homepage) is ready for the next person.

Here is the code I use now that I have found online and tried to reuse for this.

//------------------

var nPrevMouseX:Number;

var nPrevMouseY:Number;

var myTimer:Timer = new Timer (180000);

myTimer.addEventListener (TimerEvent.TIMER, fOnTimer, false, 0, true);

myTimer.start ();

function fOnTimer(evtTimer:TimerEvent):void {}

If the mouse has not moved

If (mouseX == nPrevMouseX & & mouseY == nPrevMouseY) {}

gotoAndStop (1);

stage.addEventListener (MouseEvent.MOUSE_MOVE, fOnMouseMove, false, 0, true);

myTimer.reset ();

} else {}

Capture the mouse position

nPrevMouseX = mouseX;

nPrevMouseY = mouseY;

}

}

function fOnMouseMove(evtMouseMove:MouseEvent):void {}

Mouse.Show ();

Restart the timer

myTimer.start ();

Remove the listener

stage.removeEventListener (MouseEvent.MOUSE_MOVE, fOnMouseMove);

}

//----------------

Thanks for any idea you may have. Take care.

use:

var alreadyExecuted:Boolean;

{if(!alreadyExecuted)}

var myTimer:Timer = new Timer (180000);

myTimer.addEventListener (TimerEvent.TIMER, fOnTimer, false, 0, true);

myTimer.start ();

alreadyExecuted = true;
stage.addEventListener (MouseEvent.MOUSE_DOWN, mousedownF, false, 0, true);

}

function fOnTimer(evtTimer:TimerEvent):void {}

{if(this.currentFrame!=1)}

gotoAndStop (1);

}

}

function mousedownF(e:MouseEvent):void {}

Restart the timer

myTimer.reset)

myTimer.start)

}

//----------------

Tags: Adobe Animate

Similar Questions

  • Whenever I start my computer I am able to get to the loading screen, but the computer reaches the login screen it restarts. This happens all the time. It does not matter what I try to start if no failure or normal startup mode

    This happens all the time. It does not matter what I try to start if no failure or normal startup mode. I tried to use the repair from the vista cd. It's 64-bit computer with AMD phenom processor and an Asus motherboard there is a HDD 500 GB and 4 GB of memory.

    you have AVG Antivirus?

    If so, these instructions will fix it: http://forums.avg.com/ww-en/avg-free-forum?sec=thread&act=show&id=94159

    teengeek.freehostingcloud.com

  • I had endless problems with Lightroom since the purchase of subscription for one year in December 2014. Now, the development Module was disabled, as they claim that my subscription has expired...  He spent more time to work does not, and I'm bitterly briv

    I had endless problems with Lightroom since the purchase of subscription for one year in December 2014. Now, the development Module was disabled, as they claim that my subscription has expired...  He spent more time to work does not, and I bitterly regret it.  Help, please!

    Open the Adobe Creative Cloud application then go to preferences then sign out and then sign back with the same Adobe ID that you used to purchase the subscription photographers, that is to say the same e-mail address and password.

    Then open Lightroom and go to the Help menu and make sure that it is signed in with that Adobe ID email address.

  • Cloud to adobe InDesign download fails with shoing error it can not extract the files in the temporary file.  I tried several times and restarted does not.  What can I do about it?

    Cloud to adobe InDesign download fails with shoing error it can not extract the files in the temporary file.  I tried several times and restarted does not.  What can I do about it?

    To refer to EX11 some:

    Creative cloud (WIP) error codes | Error postal codes of Mylenium

    Mylenium

  • Example of Date comparison work not as expected...

    First of all, sorry for the creation of another post.  Didn't know if I should of just added to a previous message (s) now that I have an example of comparison of date/time works do not as expected.

    I understand that the calendar will use the time zone for the device.  My device is located to the EAST (-0500).

    The following code works fine when the time is set to h, however, does not as expected when in AM...

    java.util.Calendar d1 = java.util.Calendar.getInstance (); now
    java.util.Calendar d2 = java.util.Calendar.getInstance (); now
                      
    String date = ' 11/10/2011-05:05;
                      
    yy int = 0, mm = 0, SD = 0, h = 0, e = 0;
                      
    mm = Integer.parseInt (date.substring (0, 2)) - 1; January = 0
    DD = Integer.parseInt (date.substring (3, 5));
    YY = Integer.parseInt (date.substring (6, 10));
    HR = Integer.parseInt (date.substring (11,13));
    MI = Integer.parseInt (date.substring (14.16));

    D2. Set (Calendar.YEAR, AA);
    D2. Set (Calendar.MONTH, mm);
    D2. Set (Calendar.DATE, dd);
    D2. Set (Calendar.HOUR, human resources);
    D2. Set (Calendar.MINUTE, mi);
    D2. Set (Calendar.MILLISECOND, 0);
                      
    String ampm = date.substring (17, 19);
    If (ampm is 'AM')
    {
    D2. Set (Calendar.AM_PM, Calendar.AM);
    }
    on the other
    {
    D2. Set (Calendar.AM_PM, Calendar.PM);
    }
                      
    long t1 = d1.getTime () .getTime ();
    long t2 = d2.getTime () .getTime ();

    String strCurrentDate = new Date (t1) m:System.NET.SocketAddress.ToString ();
    String strActivateDate = new Date (t2) m:System.NET.SocketAddress.ToString ();
                                  
    If (t1 > = t2)
    Dialog.Inform ("current date of" + strCurrentDate + "is superior to activate date of" + strActivateDate);
    If (t1<>
    Dialog.Inform ("current date of" + strCurrentDate + "is less that activate date of" + strActivateDate);

    The result of current date/time is fine, but the result for strActivateDate is returned as "Tue Oct 11 17:15:48 2011 America/New_York '.  Date is fine, however, is not time.  Time ends as PM (17:05).

    Am I missing something obvious here?  Again, excuse me for the post, maybe should added on the previous post, but I think that this new post can be useful to others in the same situation.  Would appreciate any comments.  Thank you 1 million.

    Karim

    It's what I tell you is wrong and how to fix it.

    http://StackOverflow.com/questions/513832/how-do-i-compare-strings-in-Java

    In short: Do not compare with the help of is, use the equals() method.

  • HP DV7-4050ea: Date &amp; only time not updated DV7-4050ea

    I have a HP Pavillion DV7-4050ea. Whenever I restart the computer, the date time not not to date. I changed the battery (CR2032) without result. Is this what can I do to make sure of the correct date and time of updates every time I restart the computer.

    Hello

    Try to manually set the date/time of the bios again.

    You should see that the first field highlighted is the time value - set this to the correct time by using f5 and f6 (f5 will reduce the number & f6 it will increase).  When it is correct, press ENTER to highlight the Minute field and again, use f5 & f6 to set the correct minutes.

    When finished, press the arrow down to select the first Date field.  This should be for the month, so using f5 & f6 to enter the correct value.

    Press Enter to highlight the field day and this, and then press ENTER to highlight the year field and then set this.

    If you are happy with the settings of Date and time, press f10 and press ENTER to save the settings and exit the bios.

    Let windows load completely.  If the Date and time correct does not appear, go to the control panel and set the Date and time correct here.

    Restart computer and check if this has fixed the problem.

    Kind regards

    DP - K

  • ORA-00285: TIME not given as constant string

    Hello

    in 10g R2:
    How to write then:
    SQL> recover database until time to_date"('17-02-2009 06:27:00','DD-MM-YYYY HH24:MI:SS')";
    ORA-00285: TIME not given as a string constant
    SQL> recover database until time '17-02-2009 06:27:00';
    ORA-01861: literal does not match format string
    
    
    SQL> recover database until time 'to_date"('17-02-2009 06:27:00','DD-MM-YYYY HH24:MI:SS')"';
    ORA-01841: (full) year must be between -4713 and +9999, and not be 0
    Thank you.

    Hello..

    TRY: -.

    DATABASE TO RECOVER UP TO THE HOUR ' 2009-02 - 17:06:27:00';

    HTH
    Anand

  • I download my e-mails from gmail to my computer using firefox and only downloads of firefox 3 at a time, not all of them, I. Takes forever.

    I download my e-mails from gmail to my computer using firefox and only downloads of firefox 3 at a time, not all of them, I. Takes forever.

    Sorry, I should have to say that I use Firefox Thunderbird. To automatically download my emails to gmail, but it downloads only 2 or 3 when I did about 50 per day. I have to click again and again. It is on a desktop computer, laptop computer, in fact. My office works very well. Thanks for any help.

  • I'll buy 6 s - model No. mkqv2ah/a in qatar. This device will support sri lanka face time? Sri lanka face the time not forbidden.

    I'll buy 6 s - model No. mkqv2ah/a in qatar. This device will support sri lanka face time? Sri lanka face the time not forbidden.

    No, any device purchased from a country where the FaceTime is prohibited or limited to certain carriers can never have Facetime out of that country, or with other companies except those he goes on.

    If you want an iPhone for FaceTime, buy it in a country where it is not prohibited or limited.

    Also, note that iPhone warranty is limited to the country of purchase, so if something haopens to the iPhone that requires a repair of office you will need to consider physically return to the country of purchase.

    Its best to buy the iPhone in the country that you intend to use.

  • CMOS Date/time not Set__CMOS Settings Wrong

    Hello

    I use Windows XP and Vista.

    When I turn on my computer, it displays the error message:

    CMOS Date/time not set

    Fault of CMOS settings

    How could I solve this problem without changing the motherboard?

    Replace the CMOS battery. It's cheap (~ $5.00) and easy. After replacing the battery, you will need to go into the BIOS to set the date and time.

    How to replace the CMOS in your PC battery -http://www.liverepair.com/encyclopedia/articles/cmosreplace.asp
    How to replace the CMOS battery - http://www.computerhope.com/issues/ch000239.htm

    MS - MVP - Elephant Boy computers - don't panic!

  • given the date and time not set when computer starts. also have a problem with typing

    by turning on my computer, sometimes it lights up at all, and then I try several times so that it lights up. When switching on the main screen, it says error due to the date and time not set and puts my computer starts in safe mode. When I am that I then have to set the date and time again. Why this keep happening?

    on my second question that I have is when I type an email or anything, my writing will just jump on another line and start typing in the middle of other sentences. Why is it jump around like that?

    You may have a failed in your motherboard CMOS battery.

    It's a battery power supply NET, size piece that keeps your system settings when your computer is off.

    They cost about $5 to replace.

    http://www.computerhope.com/issues/ch000239.htm

    How to replace the CMOS battery in the above link info.

    See you soon.

    Mick Murphy - Microsoft partner

  • Count down to a specific time (not midnight)

    Hello all;

    I quickly do a countdown to a Web site that account down to a specific date & time (not midnight). I need like may 4, 2011, at 09:10.

    I used a tutorial to create a timer that counts down to midnight, but necessary change to the countdown at a time accurate as midnight.

    Here's the code. Can someone help me change the code below. Thank you.

    Tim



    var today: Date = new Date();
    Those of var = today.getFullYear ();
    currentTime var = today.getTime ();

    var targetDate:Date = new Date (currentYear, 1, 12);
    var Date_cible = targetDate.getTime ();
    If (Date_cible < = 0) {}
    gotoAndStop (3);
    }

    var Date_cible = timeLeft - currentTime;
    var s = Math.floor (timeLeft/1000);
    var min = Math.floor (sec/60);
    var h = Math.floor (minutes/60);
    var days = Math.floor (hrs/24);
    sec = String (s % 60);
    If (sec.length < 2) {}
    s = '0' + seconds;
    }
    min = String (min % 60);
    If (min.length < 2) {}
    min = "0" + min;
    }
    h = String (24 hrs %);
    If (hrs.length < 2) {}
    h = "0" + hrs;
    }
    days = String (days);
    var counter: String = days + ":" + h + ":" + min + ":" + seconds;
    time_txt. Text = counter;

    I have not watched the rest of the code, but if you say it works, then all you really need to do is to settle the arguments of Date_cible.

    The constructor for a Date object is...

    Date (year, month, date, hour, minutes, seconds, milliseconds)
     
    So just fill out the data you need instead of what you have...
     
    var targetDate:Date = new Date (year, month, date, hour, minute, seconds, milliseconds);
  • When I try to get on the stick of msn games, it tells me to try re launch my browser every time. Also does the thing same om poker.

    When I try to get on the stick of msn games, it tells me to try re launch my browser every time.  Also does the thing same om poker.

    Hello

    1. what web browser is installed in the computer?

    2 the actors that this problem occurs with all games online?

    If you use Internet explorer, I suggest you to see link and check.

    The problems of games online using Internet Explorer

    http://support.Microsoft.com/kb/2528246

    WARNING: Reset Internet Explorer settings can reset security settings or privacy settings that you have added to the list of Trusted Sites. Reset the Internet Explorer settings can also reset parental control settings. We recommend that you note these sites before you use the reset Internet Explorer settings

  • After updating to Firefox 15 it crashes at the end of a javascript call window.close (); opener.alert ('test'); Does work as expected or is this a bug?

    After updating to Firefox 15, it crashes after a popup called javascript window.close (); opener.alert ('test'); Does work as expected or is this a bug?

    It works better if you disable the modal prompt temporarily as a test by setting prompts.tab_modal.enabled false on the subject: config page?

  • The function "Time in seconds" does not work as I expect. Can someone tell me why?

    In the attached VI my hour entry to the function "Time in seconds" is 11, but the output is 12:09. Why is he 12:09 and not 11:09?

    Thank you.

    chuck72352 wrote:
    I tried and it works, but I don't know why or how it works.

    Tried what idea? If you talk about my idea above, position 10 of the cluster is "is DST', look at the help. The only way to make sense would be to identify the components of the cluster correctly, as NEITHER should have done, so the names will get to the Unbundle propigated.

Maybe you are looking for