Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 339921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:34:04+00:00 2026-05-12T10:34:04+00:00

p2 = setInterval(function () { clearInterval(p2); some code here; }, waitTime) I need to

  • 0

p2 = setInterval(function ()
{
clearInterval(p2);
some code here;
}, waitTime)

I need to break out of this interval in a separate function.

This plays an array of SWF movies – there is a purge function that needs to stop this interval.

How can I stop this interval from a separate function in AS2?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T10:34:05+00:00Added an answer on May 12, 2026 at 10:34 am

    the whole thing with setInterval is scope.

    the way your code looks, p2 is in the main timeline and it belongs to this/_level0/_root right ?

    clearInterval() is a global function as well, so you can call it from any other function nested in any movie clip, as long as you can get access to the interval’s id (p2 in your case)

    so if you have some like:

    p2 = setInterval(function () { trace('p2 running'); }, waitTime);
    

    you can have a separate function like

    function clearP2(){
    clearInterval(p2);
    }
    

    if that function is nested in some clip you can always use the dirty all _root ( as in absolute path )

    e.g.
    //clearP2 lives in a nested clip far far away from _root

    function clearP2(){
    clearInterval(_root.p2);
    }
    

    of course you can use relative paths as well

    function clearP2(){
    clearInterval(_parent._parent._parent.p2);//depending on the clips hierarchy
    }
    

    the idea to keep in mind is to make sure you can access the interval’s ID where you need it, clearInterval() is global

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 186k
  • Answers 186k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Something like this does basic regex validation. You can get… May 12, 2026 at 5:10 pm
  • Editorial Team
    Editorial Team added an answer Actually, there is a way: IgnoreDataMemberAttribute See http://msdn.microsoft.com/en-us/library/system.runtime.serialization.ignoredatamemberattribute.aspx and http://msdn.microsoft.com/en-us/library/cc656732.aspx… May 12, 2026 at 5:10 pm
  • Editorial Team
    Editorial Team added an answer That means that the 16 most significant bits of label… May 12, 2026 at 5:10 pm

Related Questions

char *p = new char[200]; char *p1 = p; char *p2 = &p[100]; delete
Lets say you have this: P1 = (x=2, y=50) P2 = (x=9, y=40) P3
This compiles: int* p1; const int* p2; p2 = p1; This does not: vector<int*>
I have the method (Delphi 2009): procedure TAnsiStringType.SetData(const Value: TBuffer; IsNull: boolean = False);

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.