15. april 2003 - 11:05
Der er
5 kommentarer og 1 løsning
pause i onEnterFrame
Hej Jeg har følgende frameaction, som henholdsvis fader nogle billeder frem og tilbage. nu vil jeg gerne have at den holder en pause når et billede er fadet frem. -faetter_br ______________________________________ onEnterFrame = function () { if (curpic == antalpics) { if (_root["square"+curpic]._alpha>0) { curalpha = _root["square"+curpic]._alpha -= step; curalpha1 = _root["square"+1]._alpha += step; } else { curalpha = _root["square"+curpic]._alpha=0; curalpha1 = _root["square"+1]._alpha=100; curpic = 1; } } else if (_root["square"+curpic]._alpha>0) { curalpha = _root["square"+curpic]._alpha -= step; curalpha1 = _root["square"+(curpic+1)]._alpha += step; } else { curalpha = _root["square"+curpic]._alpha=0; curalpha1 = _root["square"+(curpic+1)]._alpha=100; curpic++; } };
Annonceindlæg fra Computerworld
Geopolitik i cyberspace
Mark Fiedel i Styrelsen for Samfundssikkerhed påpeger behovet for, at Danmark kigger kritisk på leverandørafhængighed.
13. juni 2025
22. april 2003 - 18:22
#1
Kunne det virke med noget a la dette: interval = 5; onEnterFrame = function () { if (curpic == antalpics) { startInterval = Math.round(getTimer()/1000); if (_root["square"+curpic]._alpha>0) { curalpha = _root["square"+curpic]._alpha -= step; curalpha1 = _root["square"+1]._alpha += step; } else if(_root["square"+curpic]._alpha<=0 && Math.round(getTimer()/1000) >= startInterval+interval){ curalpha = _root["square"+curpic]._alpha=0; curalpha1 = _root["square"+1]._alpha=100; curpic = 1; } } else if (_root["square"+curpic]._alpha>0) { curalpha = _root["square"+curpic]._alpha -= step; curalpha1 = _root["square"+(curpic+1)]._alpha += step; } else { curalpha = _root["square"+curpic]._alpha=0; curalpha1 = _root["square"+(curpic+1)]._alpha=100; curpic++; } };
28. april 2003 - 16:23
#5
Offentliggør lige scriptet... antalpics = 7; picname = "ansigt"; path = "pics/"+picname; waiting = false; square._alpha = 0; currentAlpha = 100; nextAlpha = 0; interval = 3; currenPic = 1; step = 15; tid = 0; //------------ for(i=0;i<=antalpics;i++){ duplicateMovieClip("square", "square"+i, i); loadMovie(i+".jpg", "square"+i); _root["square"+i]._alpha = 0; //setProperty(_root["square"+i], _x, (150*i)); } square1._alpha = 100; _root.onEnterFrame = function(){ if(currentAlpha >= 100){ if(!waiting){ startTime = Math.round(getTimer()/1000); waiting = true; }else if(waiting && Math.round(getTimer()/1000) >= startTime+interval){ waiting = false; currentAlpha -= step; nextAlpha += step; } }else if(currentAlpha <= 0){ currentPic++; if(currentPic > antalpics){ currentPic = 1; } currentAlpha = 100; nextAlpha = 0; }else{ currentAlpha -= step; nextAlpha += step; } if(currentPic == antalpics){ _root["square"+currentPic]._alpha = currentAlpha; _root.square1._alpha = nextAlpha; }else{ _root["square"+currentPic]._alpha = currentAlpha; _root["square"+(currentPic+1)]._alpha = nextAlpha; } }