# Having trouble calling a function inside a class from the main timeline

**URL:** <https://forum.kirupa.com/t/having-trouble-calling-a-function-inside-a-class-from-the-main-timeline/294300>\
**Category:** Uncategorized\
**Created:** [August 12, 2009, 7:24am UTC](https://forum.kirupa.com/t/having-trouble-calling-a-function-inside-a-class-from-the-main-timeline/294300 "2009-08-12T07:24:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThreeDollarBill](https://avatars.discourse-cdn.com/v4/letter/t/7ea924/32.png) [@ThreeDollarBill](https://forum.kirupa.com/u/ThreeDollarBill)\
**Post date:** [August 12, 2009, 7:24am UTC](https://forum.kirupa.com/t/having-trouble-calling-a-function-inside-a-class-from-the-main-timeline/294300/1 "2009-08-12T07:24:55Z")

</div>

i am getting a “ReferenceError: Error #1069: Property beginTargetLock not found on AimCursor and there is no default value.”

code on the main timeline:

```auto
var aimCursor = new AimCursor();
addChild(aimCursor);
aimCursor.beginTargetLock();

```

code inside the AimCursor class:

```auto
package
{
    import flash.display.*;
    import flash.events.*;
    
    public class AimCursor extends MovieClip
    {
        public function AimCursor()
        {
            trace("im here...");
        }
        
        function beginTargetLock():void
        {
            trace("target is locked");
        }
    }
}

```
