allora ho questo problema sin qui quello fatto
nn guardate il fatto ch enn ho pubblicato ancora la cosa al 100%
è per farvi capire la cosa semplicemete
http://www.timelaps.com/prova.html
ho 8 mc istanziati mc1,mc2.... mc3 ecc... li posiziono in maniera random
ora vorrei cercare di gestire anche la collisione tra gli stessi... qualcuno ha qualchye idea o una soluzione? grazie
codice:MovieClip.prototype._tween = function(clip, xArr, yArr, tempo, bounce) { clip.xArr = Math.floor(xArr); clip.yArr = Math.floor(yArr); clip.tempo = tempo; clip.bounce = bounce; clearInterval(clip.xInt); clip.xMove = function() { clip.xspost = (clip.xArr-clip._x)/clip.bounce; clip._x += clip.xspost; if (Math.round(clip._x) == Math.round(clip.xArr)) { clearInterval(clip.xInt); clip._x = Math.round(clip.xArr); } }; clip.xInt = setInterval(clip.xMove, clip.tempo); clearInterval(clip.yInt); clip.yMove = function() { clip.yspost = (clip.yArr-clip._y)/clip.bounce; clip._y += clip.yspost; if (Math.round(clip._y) == Math.round(clip.yArr)) { clearInterval(clip.yInt); clip._y = Math.round(clip.yArr); } }; clip.yInt = setInterval(clip.yMove, clip.tempo); }; for (var i=1; i<8; i++) { rndX = Math.random()*1500; rndY = Math.random()*1500; _root.container["mc"+i]._tween(_root.container["mc"+i],rndX,rndY, 40, 3); }

Rispondi quotando
