Setinterval Function - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

setInterval function

setInterval(functionReference:Function, interval:Number, [param1:Object,
param2, ..., paramN]) : Number
setInterval(objectReference:Object, methodName:String, interval:Number,
[param1:Object, param2, ..., paramN]) : Number
Calls a function or a method of an object at periodic intervals while a SWF file plays. You can
use
to execute any function repetitively over time.
setInterval()
Use the following tips when working with
Identify the scope of the function being called.
Identify the scope where the interval ID (the return value of
Clear previously set intervals before starting new ones.
These tips are discussed in further detail in the following paragraphs.
Identify the scope of the function being called. To identify the scope of the function being
called, pass the object where the
first parameter and the method name you want to execute as the second parameter (as shown
in the second signature). This ensures that the desired method is executed from the scope of
the object reference passed in. When the method is executed in this manner, it can reference
member variables on the object using the
Identify the scope where the interval identifier was set. To identify the scope where the
interval identifier (
intervalId
scope that you pass to
interval identifier at
this.intervalId
Clear previously set intervals. To clear previously set intervals before starting new ones, you
should usually call
clearInterval()
not overwrite or otherwise destroy your
the currently running interval. To call
both the initiating script and the script being executed must have access to the
shown in the Examples.
Always be sure to call
Availability: ActionScript 1.0; Flash Player 6
Parameters
functionReference:Function
96
ActionScript language elements
setInterval()
setInterval()
this
) was set, you can assign it to a member variable on the object
. In this way, the function being called can locate the
setInterval()
.
before calling
intervalId
clearInterval()
clearinterval()
- A reference to the function to be called.
:
setInterval()
method can execute (the object scope) as the
keyword.
. This ensures that you do
setInterval()
variable, which is the only reference to
prior to calling
when you want the script to stop looping.
) was set.
,
setInterval()
, as
intervalId

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents