beautypg.com

Adobe Extending Flash Professional CS4 User Manual

Page 349

background image

327

EXTENDING FLASH CS4 PROFESSIONAL

Math object

Example
The following example stores the value for the distance between pt1 and pt2 in the

dist

variable:

var pt1 = {x:10, y:20}

var pt2 = {x:100, y:200}

var dist = fl.Math.pointDistance(pt1, pt2);