ClaudiuCC 1 Report post Posted June 18, 2007 am gasit intr-un flash la actionscript o comanda pe care ma tot chinui sa o descifrez si nu reusesc :stars: .poate reusesti tu sa ma ajuti actionscript1 imgWidth = 60; visWidth = 420; mw = mPos._width - 420; imgNum = mw / imgWidth; divNum = Math.ceil(imgNum / 5); if (divNum * 4 < Math.floor(imgNum)) { ++divNum; } // end if m5 = -1 * imgWidth * divNum; _global.rate = 5; target = 0; onEnterFrame = function () { m_x = mPos._x; dist = Math.abs(target - m_x); m_move = dist / rate; if (m_x > target) { mPos._x = mPos._x - m_move; } // end if if (m_x < target) { mPos._x = mPos._x + m_move; } // end if }; stop (); actionscript1.1 target = m5; onEnterFrame = function () { m_x = mPos._x; dist = Math.abs(target - m_x); m_move = dist / rate; if (m_x > target) { mPos._x = mPos._x - m_move; } // end if if (m_x < target) { mPos._x = mPos._x + m_move; } // end if }; unde: - mPos este numele unui frame - _x coordonata x dupa cuym vedeti, de de actionscript1 este legat actionscript1.1 Share this post Link to post Share on other sites
radu84 0 Report post Posted June 19, 2007 pai asta e matematica pura. schimba variabilele si "joaca-te" cu valorile alea. asa cred ca o sa fie mai usor sa iti dai seama numa bine Share this post Link to post Share on other sites
ClaudiuCC 1 Report post Posted June 19, 2007 (edited) am incercat, dar nu stiu ce vrea sa fie visWidth , de asemenea nu stiu ce inseamna semnul "++" care este gasit la "++divNum" help!! Edited June 19, 2007 by Cipixxx Share this post Link to post Share on other sites
argv 4 Report post Posted June 19, 2007 ++ inseamna incrementare ++divNum este ca si cum ai scrie divNum = divNum + 1 Codul care l-ai scris acolo cred ca calculeaza niste coordonate pentru afisarea unui obiect Share this post Link to post Share on other sites
ClaudiuCC 1 Report post Posted June 19, 2007 (edited) Codul care l-ai scris acolo cred ca calculeaza niste coordonate pentru afisarea unui obiect Trebuie sa se ajunga la aceste coordonate - poza mica cu urmatoarele coordonate si dimensiuni : W:60 x:0 ; H:60 y:0 - poza mare cu urm. coord. si dim: W:450 x:280 ; H:225 y:125 - mPos._Width = 1790px Rezultatul calculelor: imgWidth = 60 visWidth = 420 mw=mPos._width - 420 imgNum = mw/imgWidth = 1370/450 = 3,04 divNum = Math.Ceil (imgNum/5) = 1 if (divNum *4 < Math.floor(imgNum)) { ++divNum; } //end if /// if (1*4<3) { ++divNum; } //end if ///, unde /// reprezinta calclulele facute de mine.Nu fac parte din program m5 = -1*imgWidth*divNum = -1 *60*1 = -60 _global.rate=5 nush exact ce vrea sa reprezinte target=0 onEnterFrame=Function() {m_x = mPos._x = 0 dist = Math.abs(target - m_x) = 0 m_move = dist / rate; nush ce ii rate = 0 if (m_x > target) { mPos._x = mPos._x - m_move; } // end if if (m_x < target) { mPos._x = mPos._x + m_move; } // end if }; stop (); help!! chiar nu vad cum rezultatele astea duc la marirea pozei mici Edited June 19, 2007 by Cipixxx Share this post Link to post Share on other sites
ClaudiuCC 1 Report post Posted June 19, 2007 am rezolvat problema...topicul poate fi inchis Share this post Link to post Share on other sites