Jump to content
Forum Roportal
ClaudiuCC

Am nevoie de descifrare

Rate this topic

Recommended Posts

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 :biggrin:

 

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

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

am incercat, dar nu stiu ce vrea sa fie visWidth , de asemenea nu stiu ce inseamna semnul "++" care este gasit la "++divNum"

 

 

help!! :biggrin:

Edited by Cipixxx

Share this post


Link to post
Share on other sites

++ 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
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 by Cipixxx

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×