all groups > flash actionscript > november 2007 >
You're in the

flash actionscript

group:

confused about syntax


confused about syntax dsdsdsdsd
11/2/2007 7:08:11 PM
flash actionscript: hello;

I am looking at Robert Penner Easing Equations;

he includes this equation: c*(t/=d)*t + b

what does the =d mean, specifically the '=' ?

thanks
Re: confused about syntax kglad
11/2/2007 7:46:06 PM
:



t /= d

// is the same as:

Re: confused about syntax dsdsdsdsd
11/2/2007 9:59:45 PM
kglad, thanks for responding;

and how can an equality statement be used in an actionable function?
in other words, how is this statement supposed to work in the middle of an
equation?


thanks
dsdsdsdsd
Re: confused about syntax kglad
11/2/2007 10:21:04 PM
he's just changing t to be t/d within the paranethesis. and from that point
going forward, t has beend changed to t/d. in particular, t outside the
paranthesis is t/d

so, it's just a computation tool to speed the calculation of

(t/d)*(t/d);

ie, instead of two divisions and one multiplication, he's performing one
division and one multiplication.

that type of coding is left-over from the old days of computing when machine
speeds weren't that great and writing efficient code was needed for things to
run smoothly and decrease the need for hardware upgrades. in the old days,
hardware was expensive. programmers were cheap(er).

now, that type of coding is frowned upon because, while it does decrease the
need for hard-ware updates, it costs more in time to edit because it's
difficult to understand. and programmer costs are now much more expensive than
hardware.
Re: confused about syntax dsdsdsdsd
11/3/2007 12:04:37 AM
kglad, thanks, interesting;

Re: confused about syntax kglad
11/3/2007 2:13:28 AM
AddThis Social Bookmark Button