Chapter 14 Example 1
♥0 |
Line 18 |
Modified 2009-11-05 04:46:28 |
MIT License
archived:2017-03-10 19:57:30
ActionScript3 source code
/**
* Copyright actionscriptbible ( http://wonderfl.net/user/actionscriptbible )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/8nzg
*/
package {
import com.actionscriptbible.Example;
import flash.geom.Point;
public class ch14ex1 extends Example {
public function ch14ex1() {
var p1:Point = new Point();
trace(p1); //(x=0, y=0)
p1.x = 1;
p1.y = 1;
trace(p1); //(x=1, y=1);
var p2:Point = new Point(4, 3);
trace(p2); //(x=4, y=3)
trace(p2.length); //5 (the hypotenuse of a right triangle with edges 3,4)
var p3:Point = p1.add(p2);
trace(p3); //(x=5, y=4)
}
}
}