03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

See also<br />

duplicateMovieClip function, duplicateMovieClip<br />

(MovieClip.duplicateMovieClip method), attachMovie (MovieClip.attachMovie<br />

method), removeMovieClip (MovieClip.removeMovieClip method),<br />

createEmptyMovieClip (MovieClip.createEmptyMovieClip method)<br />

setInterval function<br />

setInterval(functionName:Object, interval:Number [, param1:Object, param2,<br />

..., paramN]) : Number setInterval(objectName:Object, methodName:String,<br />

interval:Number [, param1:Object, param2, ..., paramN]) : Number<br />

Calls a function or a method or an object at periodic intervals while a SWF file plays. You can<br />

use an interval function to update variables from a database or to update a time display.<br />

If interval is greater than the SWF file's frame rate, the interval function is only called each<br />

time the playhead enters a frame; this minimizes the impact each time the screen is refreshed.<br />

Note: In Flash Lite 2.0, the interval passed into this method is ignored if it is less than the<br />

SWF file's frame rate <strong>and</strong> the interval function is called on the SWF file's frame rate interval<br />

only. If the interval is greater than the SWF file's frame rate, the event is called on the next<br />

frame after the interval has elapsed.<br />

Parameters<br />

functionName:Object - A function name or a reference to an anonymous function.<br />

interval:Number - The time in milliseconds between calls to the functionName or<br />

methodName parameter.<br />

param:Object [optional] - Parameters passed to the functionName or methodName<br />

parameter. Multiple parameters should be separated by commas: param1,param2,<br />

...,paramN<br />

objectName:Object - An object containing the method methodName.<br />

methodName:String - A method of objectName .<br />

Returns<br />

Number - An identifying integer that you can pass to clearInterval() to cancel the interval.<br />

Example<br />

Usage 1: The following example calls an anonymous function every 1000 milliseconds (1<br />

second).<br />

setInterval( function(){ trace("interval called"); }, 1000 );<br />

74 ActionScript language elements

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!