View Full Version : Hold for 5 secs!
johan
August 30th, 2002, 07:08 AM
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.
wirebrain
August 30th, 2002, 07:30 AM
//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.
eki
August 30th, 2002, 07:58 AM
Hi,
Just put this code in the first frame
Function moveFrames(){
if(_currentframe == 1){
gotoAndStop(2);
} else {
gotoAndStop(1);
}
}
setInterval (moveFrames, 5000);
bye
SHO
upuaut
August 30th, 2002, 08:05 AM
man.. eki.. you have some nice code. Where you been hanging out in Moock's ear??
eki
August 30th, 2002, 08:23 AM
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
eki
August 30th, 2002, 08:26 AM
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
upuaut
August 30th, 2002, 09:14 AM
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.
eki
August 30th, 2002, 10:04 AM
Hi,
Thanks to you I'm flettered now with so many good comments about me... ;¬)
bye
SHO
pom
September 29th, 2002, 08:24 AM
I'm putting this in the Best of Kirupa until someone does a decent tutorial about setInterval.
pom :)
Hitby
October 24th, 2002, 05:07 AM
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
kO2n
July 22nd, 2003, 09:48 AM
Function moveFrames(){ <-- Capital 'F', should be lowercase 'f'.
Regards,
Viru.
pom
July 23rd, 2003, 01:26 PM
AS is not case sensitive :)
senocular
July 23rd, 2003, 01:38 PM
some parts are
if
function
onClipEvent
etc
though any variable you make is not.
h88
July 23rd, 2003, 01:48 PM
instanceof too.
h88
July 23rd, 2003, 02:08 PM
Almost all the entries in the following table are case-sensitive:
http://css2.mcad.edu/help/flashmx/flash/html/12_understanding18.html
kO2n
July 23rd, 2003, 04:40 PM
function is case senisitive.
Regards,
V.
mlk
July 23rd, 2003, 07:28 PM
:POM shoots himself in the head:
:everybody else wonders how he can be such a good AScripter =):
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.