marcusvca 0 Denunciar post Postado Fevereiro 13, 2008 Bom dia, moçada. Vim deixar esse tópico aqui depois de fritar umas horas em cima desse problema. Dei uma revirada no F1 do flash, nos tópicos aqui do fórum, em alguns outros e não achei uma solução. É o seguinte: preciso que meu MC instanciado como "setadir" fique inativo por um espaço de tempo depois que for pressionado. Isso evita alguns bugs na minha animação. Alguém me sugere algo? (Ps.: procure "setadir" sem as aspas no Ctrl+F pra facilitar :D) Código: #include "mc_tween2.as" var citens:Number = 20; frente._alpha = tras._alpha=0; _root.gal.setMask(_root.mask); // POSICIONA AS ITENS var xbas = 36.3; var xint = 0; var xval = 0; _root.gal.item0._visible = 0; for (i=1; i<=citens; i++) { xval = xbas+xint; duplicateMovieClip(_root.gal.item0, "item"+i, i); _root.gal["item"+i]._x = xval; _root.gal["item"+i]._y = 54; _root.gal["item"+i].txt = "ITEM"+i; xint += 108; } // APARECEM OS ITENS for (i=1; i<=citens; i++) { _root.gal["item"+i]._xscale = _root.gal["item"+i]._yscale=0; _root.gal["item"+i].scaleTo(100,0.6,"easeOutBack",i*.15); if (i>=citens) { //frente.alphaTo(100,0.3,"linear",1.3); //tras.alphaTo(100,0.3,"linear",1.3); if (citens>6) { mostSeta("dir","1.1"); } } } // CLICK for (i=1; i<=citens; i++) { _root.gal["item"+i].onPress = function() { this.scaleTo(95,0.2,"easeOutExpo"); }; _root.gal["item"+i].onRelease = function() { this.scaleTo(100,1,"easeOutElastic"); }; } // SETA APARECE E DESAPARECE setadir._xscale = setadir._yscale=setaesq._xscale=setaesq._yscale=0; function mostSeta(lado, delay) { _root["seta"+lado].scaleTo(100,0.6,"easeOutBack",delay); } function oculSeta(lado, delay) { _root["seta"+lado].scaleTo(0,0.6,"easeInBack",delay); } // FUNÇõES DAS SETAS cgal = Math.ceil(citens/6); xgal = 55; setadir.onPress = function() { xgal -= 648; _root.gal.xSlideTo(xgal,1,"easeInOutQuad"); if (xgal<=((cgal-1)*-648)+55) { oculSeta("dir","0.5"); } mostSeta("esq","0.5"); }; setaesq.onPress = function() { xgal += 648; _root.gal.xSlideTo(xgal,1,"easeInOutQuad"); if (xgal>=55) { oculSeta("esq","0.5"); } mostSeta("dir","0.5"); }; // SLIDE SEGUE MOUSE for (i=1; i<=citens; i++) { _root.gal["item"+i].num = i; _root.gal["item"+i].onRollOver = function() { frente.goalPos = tras.goalPos=(this.num*108)-76; }; } Compartilhar este post Link para o post Compartilhar em outros sites
marcusvca 0 Denunciar post Postado Fevereiro 13, 2008 Aê galera. Achei uma solução pro problema. Não sei se é a mais viável tecnicamente, mas funciona. Coloquei um setInterval com intervalo de um segundo desativando o click. O código tá aí! setadir.onPress = function() { this.enabled = false; xgal -= 648; _root.gal.xSlideTo(xgal,1,"easeInOutQuad"); if (xgal<=((cgal-1)*-648)+55) { oculSeta("dir","0"); } mostSeta("esq","0.5"); var tempo = setInterval(fc_tempo, 1000); function fc_tempo() { clearInterval(tempo); setadir.enabled = true; } }; setaesq.onPress = function() { this.enabled = false; xgal += 648; _root.gal.xSlideTo(xgal,1,"easeInOutQuad"); if (xgal>=55) { oculSeta("esq","0"); } mostSeta("dir","0.5"); var tempo = setInterval(fc_tempo, 1000); function fc_tempo() { clearInterval(tempo); setaesq.enabled = true; } }; Compartilhar este post Link para o post Compartilhar em outros sites