PDA

View Full Version : the 'pause' effect



j0se
September 1st, 2003, 09:01 AM
i have a button that launches a url in a new browser window

what i'd like to do is - on button press - first load an mc with a quick intro... and in a few seconds launch the new browser window

the way i would do it is something like this:

=====
on(press){

// load mc

//run 'dummy' loop to waste time
for (1; 1000; ) {
// do nothing
}

//getURL
=====

BUT i'm thinking that the loop is going to run differently on machines of different specs... so there may be visitors waiting an age for the new browser to launch

is there a way to specify a pause for x amount of 'real' seconds?

jeanphilippe
September 1st, 2003, 09:28 AM
hi
look at >> setInterval():)
exemple :

function timesUp() {
trace("Time's up!");
clearInterval(timerInterval);
}
btn.onRelease = function() {
timerInterval = setInterval(timesUp, 1000);
};

j0se
September 1st, 2003, 10:00 AM
that works fine!

thanks!
:)

claudio
September 1st, 2003, 10:08 AM
You could also use getTimer or this:intro_mc.onEnterFrame = function() {
this._currentframe == this._totalframes ? (getURL("http://www.kirupaforum.com", "_blank"), delete this.onEnterFrame) : null;
};
my_button.onPress = function() {
intro_mc.play();
};