MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference page 97

Actionscript 2.0 language reference
Table of Contents

Advertisement

- The time in milliseconds between calls to the
interval:Number
function passed in.
methodName
If
is less than the SWF file's frame rate (for example, 10 frames per second [fps] is
interval
equal to 100 millisecond intervals), the interval function is called as close in time to the value
of
as possible. Executing long, memory-intensive scripts during an interval causes
interval
delays. If the function being called initiates a change to visual elements, you should use the
updateAfterEvent()
is greater than the SWF file's frame rate, the interval function is called only after
interval
has expired and the playhead has entered the next frame; this minimizes the impact
interval
each time the screen is refreshed.
[optional] - Parameters passed to the function that was sent to
param:Object
functionReference
param1,param2, ...,paramN
objectReference:Object
methodName:String
.
objectReference
Returns
- An integer that identifies the interval (the interval ID), which you can pass to
Number
to cancel the interval.
clearInterval()
Example
Example 1: The following example traces a message at an interval of 20 milliseconds, up to 10
times, and then clears the interval. The object scope,
and the method name,
executeCallback()
var intervalId:Number;
var count:Number = 0;
var maxCount:Number = 10;
var duration:Number = 20;
function executeCallback():Void {
trace("executeCallback intervalId: " + intervalId + " count: " + count);
if(count >= maxCount) {
clearInterval(intervalId);
}
count++;
}
intervalId = setInterval(this, "executeCallback", duration);
function to make sure that the screen refreshes often enough. If
or
. Multiple parameters should be separated by commas:
methodName
- An object that contains the method specified by
- A method that exists in the scope of the object specified by
, as the second. This ensures that
executeCallback
is executed from the same scope as the calling script.
functionReference
, is passed in as the first parameter,
this
Global Functions
or
.
methodName
97

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?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF