Ciao, vengo subito al dunque:
http://www.zimmermann-design.ch/index31.html
Provate a far scorrere i quadratini rosa e vedrete che se li fato scorrere molto piano essi si avvicinanocome mai, non riesco a capire il perche?
![]()
Ho usato il seguente codice:
this.onEnterFrame= function() {
if ( pul8._x < -200 ) {
pul8._x=pul7._x+pul7._width+2.95
}
if ( pul7._x < -200 ) {
pul7._x=pul6._x+pul6._width+2.95
}
if ( pul6._x < -200 ) {
pul6._x=pul5._x+pul5._width+2.95
}
if ( pul5._x < -200 ) {
pul5._x=pul4._x+pul4._width+2.95
}
if ( pul4._x < -200 ) {
pul4._x=pul3._x+pul3._width+2.95
}
if ( pul3._x < -200 ) {
pul3._x=pul2._x+pul2._width+2.95
}
if ( pul2._x < -200 ) {
pul2._x=pul1._x+pul1._width+2.95
}
if ( pul1._x < -200 ) {
pul1._x=pul8._x+pul8._width+2.95
}
if ( pul8._x > 200 ) {
pul8._x=pul1._x-pul1._width-2.95
}
if ( pul7._x > 200 ) {
pul7._x=pul8._x-pul8._width-2.95
}
if ( pul6._x > 200 ) {
pul6._x=pul7._x-pul7._width-2.95
}
if ( pul5._x > 200 ) {
pul5._x=pul6._x-pul6._width-2.95
}
if ( pul4._x > 200 ) {
pul4._x=pul5._x-pul5._width-2.95
}
if ( pul3._x > 200 ) {
pul3._x=pul4._x-pul4._width-2.95
}
if ( pul2._x > 200 ) {
pul2._x=pul3._x-pul3._width-2.95
}
if ( pul1._x > 200 ) {
pul1._x=pul2._x-pul2._width-2.95
}
distanza = 400 - _root._xmouse;
if(distanza < 100 && distanza > -100) {
velocita = distanza / 10;
pul8._x += velocita;
pul7._x += velocita;
pul6._x += velocita;
pul5._x += velocita;
pul4._x += velocita;
pul3._x += velocita;
pul2._x += velocita;
pul1._x += velocita;
}
}
thx

come mai, non riesco a capire il perche?
Rispondi quotando