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.
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?
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;
}
}
}