Delay action by frames

How do you delay an action until a certain number of frames?
on (release) {
play();
function loadIn(movie) {
content.loadMovie(movie);
clearInterval(loadInterval);
}
loadInterval = setInterval(loadIn, 200, “musical/interviews/peteteo/peteteo.swf”);
}

This is the code for milliseconds, however, its not efective.

any clues?

You can use the movieclip._currentframe property.

how does that work?

You can retrieve the movieclip’s current frame.
What exactly you want to do?

this code which i’m using now is:
on (release) {
play();
function loadIn(movie) {
content.loadMovie(movie);
clearInterval(loadInterval);
}
loadInterval = setInterval(loadIn, 200, “musical/interviews/peteteo/peteteo.swf”);
}

What this does is that once the button is clicked on the action will not happen until 200 milliseconds later.

Instead of 200 miliseconds how do i make that 30 frames?

why do you want it 30 frames? How is your movie set up?

its just an example. i want to put any frame value in it.

i don’t want to use time as the counter. instead i want to use frames as the counter. eg.

when this button is click on the action will not happen until 30 frames later.

Something like this (be careful not to erase anything with the onEnterFrame):

on (release) {
play();
this.onEnterFrame = function () {
// this will overwrite the onEnterFrame of the timeline containing the button
this.i++;
if (this.i == 30) {
content.loadMovie("musical/interviews/peteteo/peteteo.swf");
delete this.onEnterFrame;
}
}
}

pom :slight_smile: