Hold for 5 secs!

Hi everybody,

ive got a problem with a counter… i like to have it like this… its displays the time for 5 secs (ok, that no problem… here it comes…) theni want it to go to frame 2 and show that frame for 5 secs and back to frame 1 (almost like a loop)

is that possible? thanks in advance!!

Cheers!

/J.


//frame1
sec = getSeconds();
if (sec == sec + 5) 
{
gotoAndPlay(2)
}

//frame2
sec = getSeconds();
if (sec == sec + 5) 
{
gotoAndPlay(1)
}

might have to use an onEnterframe to call that, and getSeconds might not be the exact function, but something like that.

And using the Timer would probably be a better idea come to think of it, but I’m rusty there.

I’m not sure if this will work either, its late.

Hi,

Just put this code in the first frame

Function moveFrames(){
if(_currentframe == 1){
gotoAndStop(2);
} else {
gotoAndStop(1);
}
}
setInterval (moveFrames, 5000);

bye

SHO

man… eki… you have some nice code. Where you been hanging out in Moock’s ear??

I’ve working with Flash since version 2.

I’m too bussy to working with Flash to become a ‘Flash Star’.

U can see the latest thing we’ve done in:
www.4learning.co.uk/sos

And by the way… if u want know a ‘flash star’ visit
www.robertpenner.com

bye and thanks for ur comments…

SHO

Hi again David,

I thought u may be interested in having a look to

www.multisite.org

Where i publish some of my experiments

cya

SHO

hey eki… you’re a star in my book. I judge such things on the nature and quality of scripts, not on any particular eye candy that’s been produced, or interesting web sites developed.

can’t believe we’ve got such an old timer here. Version 2.0… that’s a long time.

Watch eki guys… you’ll learn amazing things from his posts.

Hi,

Thanks to you I’m flettered now with so many good comments about me… ;¬)

bye

SHO

I’m putting this in the Best of Kirupa until someone does a decent tutorial about setInterval.

pom :slight_smile:

Hi, I’ve just been trying to use the code below to pause for five seconds.

Function moveFrames(){
if(_currentframe == 1){
gotoAndStop(2);
} else {
gotoAndStop(1);
}
}
setInterval (moveFrames, 500);

but I get the following error message

Symbol=logomc, Layer=Layer 3, Frame=1: Line 1: ‘;’ expected
Function moveFrames(){

I’ve tried sticking a semi colon in almost everywhere with no luck, any ideas?? thanks

Danny

Function moveFrames(){ <-- Capital ‘F’, should be lowercase ‘f’.

Regards,
Viru.

AS is not case sensitive :slight_smile:

some parts are

if
function
onClipEvent
etc

though any variable you make is not.

instanceof too.

Almost all the entries in the following table are case-sensitive:

http://css2.mcad.edu/help/flashmx/flash/html/12_understanding18.html

function is case senisitive.

Regards,
V.

:**POM shoots himself in the head:

:everybody else wonders how he can be such a good AScripter =):