# Class vs. instance: accessing public methods

**URL:** <https://forum.kirupa.com/t/class-vs-instance-accessing-public-methods/230004>\
**Category:** Uncategorized\
**Created:** [June 21, 2007, 10:17pm UTC](https://forum.kirupa.com/t/class-vs-instance-accessing-public-methods/230004 "2007-06-21T22:17:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aesir](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@Aesir](https://forum.kirupa.com/u/Aesir)\
**Post date:** [June 21, 2007, 10:17pm UTC](https://forum.kirupa.com/t/class-vs-instance-accessing-public-methods/230004/1 "2007-06-21T22:17:27Z")

</div>

I have a Segment class and instances of the segment class. Public functions called from the class itself fail, where functions called from instances work. Example:

```auto
 
import Scripts.Segment; // my class
import flash.geom.Point;
 
var p1:Point = new Point(1, 3);
var p2:Point = new Point(7, 4);
var p3:Point = new Point(4, 5);
var p4:Point = new Point(5, 1);
 
var mySegment1:Segment = new Segment(p1, p2); // generate two instances
var mySegment2:Segment = new Segment(p3, p4);
 
var p5:Point = mySegment1.intercept(mySegment1, mySegment2); // works
var p6:Point = Segment.intercept(mySegment1, mySegment2); // gives me an error

```

Error looks like this, by the way:  
_1061: Call to a possibly undefined method intercept through a reference with static type Class._

How do I access the methods without using an instance? Like the way one might use _Point.distance(p1, p2)_?
