Waiting x seconds
frame 1:
seconds=5;
endtime = getTimer() + seconds * 1000;
frame 2:
// nothing in here
frame 3:
if(getTimer() < endtime) gotoAndPlay(2);
frame 4:
// ready, go
- thomas Date: 07/07/2001
hallo,
mein script
keyframe 1
timeend= getTimer() +5* 1000;
keyframe 2
leer
keyframe 3
if (getTimer()<_root.timeend) {
for (i=0; i<6; i++) {
duplicateMovieClip (\"strich\", \"strich\"+i, i);
_root.strich._x += _root.strich._width;
if (_root[\"strich\"+i]>=3) {
gotoAndPlay (4);
}
}
gotoAndPlay (2);
}
keyframe 4
stop();
Mein Ziel ist es, dass jede 5 sekunde ein strich dupliziert wird und nacheinander angereiht wird. was ist da falsch.
danke für deine hilfe
- anonymous Date: 15/07/2001
ich glaube der kann kein deutsch, erzähl ihm das ganze mal auf enlisch!
- Date: 13/08/2001
- Schweizer Date: 16/11/2002
Ciao zusammen.
Meine Scriptversion ist auch effektiv. Hier der Code:
--------START OF FRAME -----------
keyframe 1
timeend= getTimer() +5* 1000;
--------END OF FRAME -------------
--------START OF FRAME -----------
keyframe 2
empty (also keine Funktion)
--------END OF FRAME -------------
--------START OF FRAME -----------
keyframe 3
if (getTimer()<_root.timeend) {
for (i=0; i<6; i++) {
duplicateMovieClip (\"kartoffelsalat\",
\"kartoffelsalat\"+i, i);
_root.kartoffelsalat._x += _root.kartoffelsalat._width;
if (_root[\"strich\"+i]>=3) {
gotoAndPlay (4);
}
}
gotoAndPlay (2);
}
--------END OF FRAME -------------
--------START OF FRAME -----------
keyframe 4
stop();
--------END OF FRAME -------------
Mein Code veranlasst per ActionScript, dass alle 5 Sekunden ein Kartoffelsalat serviert wird und gegessen werden muss. Was ist daran ungesund? - Nichts!
- Yori Date: 06/01/2003
if (start == undefined){
start = getTimer()/1000;
}
counter = getTimer()/1000;
if (counter-start<3) {
gotoAndPlay(_currentframe - 1);
}else {
start = undefined;
}
- Alvaro Vidal Date: 02/02/2003
Here I put a single frame script...
setInterval(timeChk, 5000);
this.stop();
function timeChk() {
this.play();
}
- Alvaro Vidal Date: 02/02/2003
Sorry I forget something in my script:
Interval = setInterval(timeChk, 5000);
this.stop();
function timeChk() {
clearInterval(Interval);
this.play();
}
Now better.
- kosmar Date: 17/03/2003
very clever :)
- boo Date: 17/01/2008
var counter = 0;
function callback(arg) {
counter++;
if (counter == 10) {
clearInterval(this);
counter = 0;
gotoAndStop(1);
} else {
stop();
}
}
setInterval(callback, 1000);
Add comment
Home