Hello guys,
Check this example I’ve found in a book:
var c; // A convenient reference to the *circle* clip object
var s; // A convenient reference to the *square* clip object
var deltaX; // The horizontal distance between *c* and *s*
var deltaY; // The vertical distance between *c* and *s*
var dist; // The total distance between *c* and *s*
c = _root.circle; // Get reference to the *circle* clip
s = _root.square; // Get reference to the *square* clip
deltaX = c._x - s._x; // Compute the horizontal distance between the clips
deltaY = c._y - s._y; // Compute the vertical distance between the clips
Why do they first declare a variable and only afterwards give it a value?
They do it all the time in the chapter about variables.
People always thaught me to keep my code as short as possible, and even if they didn’t thaught me that, I wouldn’t have seen the use of this tedious declaration.
Is it useful however?
Greetz