In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

point sample on 2010-11-14

Get Adobe Flash player
by nekey 14 Nov 2010
    Embed
/**
 * Copyright nekey ( http://wonderfl.net/user/nekey )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/ko9U
 */

package {
    import flash.display.Sprite;
    import flash.geom.Point;
    import flash.text.*;
    
    public class FlashTest extends Sprite {
        public function FlashTest() {
            
            var point_1:Point = new Point(12, 15);
            var point_2:Point = new Point(45, 89);
            var distanceBetween:Number = Point.distance(point_1, point_2);
            
            var result:TextField = new TextField();
            var format:TextFormat = new TextFormat();
            format.size = 20;
            result.defaultTextFormat = format;            
            
            result.text = "2点間の距離は " + distanceBetween.toString();
            result.x = 100;
            result.y = 100;
            result.width = 300;
            stage.addChild( result );
            
        }
    }
}