Álan_nov 0 Denunciar post Postado Fevereiro 15, 2011 Bom dia ! Tenho um menu de ícones onde eles são criados dinamicamente. Preciso colocar um efeito no hover, porém quando mudo um ele muda todos. Segue o arquivo .fla para olharem http://www.4shared.com/file/G8shEpoW/menu_.html Desde já agradeço a todos Vlw Compartilhar este post Link para o post Compartilhar em outros sites
Elektra 102 Denunciar post Postado Fevereiro 15, 2011 Oi Álan_nov Fica melhor você postar o code (AS1). Abraços Compartilhar este post Link para o post Compartilhar em outros sites
Álan_nov 0 Denunciar post Postado Fevereiro 15, 2011 Oi Álan_nov Fica melhor você postar o code (AS1). Abraços Creio que seja melhor baixarem o arquivo para uma melhor compreensão, mas postarei abaixo o code: Estão divididas em layers, segue elas e seu code: //Vars: //vars/////////////////////////////////////////////////////////////////////// myGlobal = this; distanza = 10; menuY = 300; voicesY = menuY-20; ///////////////////////////////////////////////////////////////////////////// //data/////////////////////////////////////////////////////////////////////// iconSize = 100; tolerDelay1 = .5; delay1 = .2; delay2 = .1; delay3 = .1; total = 5; myTolerance = 100; myMaximize = 50; menu = new Array(); menuVoices = new Array("Empresa", "Blog", "Facebook", "Twitter", "Youtube"); dragga = new Array("0", "1", "1", "1", "1", "1", "0", "0"); icons = new Array("Empresa", "Blog", "Facebook", "Twitter", "Youtube"); ///////////////////////////////////////////////////////////////////////////// //Create function createMenu() { menuBar._y = menuY-menuBar._height; for (v=0; v<total; v++) { myGlobal.attachMovie("cerchio", "circle"+(v+1), v+50); mytgt = myGlobal["circle"+(v+1)]; myTgt.num = v; myTgt.iconz.gotoAndStop(icons[v]); myTgt.iconTogo = icons[v]; // features not yet implemented in this version // myTgt.draggable = dragga[v]; ////////////////////////////////////////////// mytgt.title = menuVoices[v]; myTgt._y = voicesY; menu[v] = myGlobal["circle"+(v+1)]; } } //Spacer function spacerLeft() { mytg = menu[0]; mytg._x = menuBar._x + (mytg._width*.4); fromWho = 0; for (h=fromWho; h<total; h++) { myclp2 = menu[h]; myclp2._x = menu[h-1]._x+menu[h-1]._width*.4+myclp2._width*.4+distanza; } } function spacerCenter(fromWho) { mytg = menu[fromWho]; if (total%2 == 0) { mytg._x = menuBar._width*.4; } else { mytg._x = menuBar._width*.4 - (mytg._width*.4); } for (k=0; k<fromWho; k++) { myclp1 = menu[fromWho-k-1]; myclp1._x = menu[fromWho-k]._x-menu[fromWho-k]._width*.4-myclp1._width*.4-distanza; } for (h=fromWho; h<total; h++) { myclp2 = menu[h]; myclp2._x = menu[h-1]._x+menu[h-1]._width*.4+myclp2._width*.4+distanza; } } function spacerRight() { mytg = menu[total-1]; mytg._x = menuBar._width - (mytg._width*.4); trace(mytg) fromWho = total-1; for (k=0; k<fromWho; k++) { myclp1 = menu[fromWho-k-1]; myclp1._x = menu[fromWho-k]._x-menu[fromWho-k]._width*.4-myclp1._width*.4-distanza; } } //osx this.onMouseMove = function() { if (menuBar.hitTest(_root._xmouse, _root._ymouse, false)) { menuBar.onEnterFrame = function() { spacerCenter(Math.round(total*.5)-1); ///////////////////////////////////////////////////////// // you can use provided spacerRight(); or spacerLeft(); // functions instead of spacerCenter. // remember to change this function handler also lower // in this page and in the create menu layer actions. ///////////////////////////////////////////////////////// for (i=0; i<total; i++) { mytgt = menu; gap = Math.abs(_root._xmouse-mytgt._x); if (gap<=myTolerance) { mytgt.tag = 100+(myMaximize-gap/myTolerance*myMaximize); if (Math.abs(mytgt.tag-mytgt._xscale)>= tolerDelay1) { mytgt._alpha = 100; mytgt.vel = ((mytgt.tag-mytgt._xscale)* delay1); mytgt._xscale += mytgt.vel; mytgt._yscale += mytgt.vel; } else { mytgt._xscale = mytgt.tag; mytgt._yscale = mytgt.tag; } } else { mytgt.scale = 100; mytgt.newScale = (mytgt.scale-mytgt._xscale)*delay2; mytgt._xscale += mytgt.newScale; mytgt._yscale += mytgt.newScale; } } }; } else { menuBar.onEnterFrame = function() { scaleCount = 0; for (i=0; i<total; i++) { mytgt = menu; mytgt.scale = 100; mytgt.newScale = (mytgt.scale-mytgt._xscale)*delay3; mytgt._xscale += mytgt.newScale; mytgt._yscale += mytgt.newScale; if (mytgt._xscale<=101) { mytgt._xscale = 100; scaleCount++; } if (scaleCount == total) { delete menuBar.onEnterFrame; } spacerCenter(Math.round(total*.5)-1); //spacerRight(); //spacerLeft(); } }; } }; //create menu createMenu(); spacerCenter(Math.round(total*.5)-1); //spacerRight(); //spacerLeft(); stop(); Compartilhar este post Link para o post Compartilhar em outros sites