# \[AS2\] Is it possible the class can call the function that in the timeline?

**URL:** <https://forum.kirupa.com/t/as2-is-it-possible-the-class-can-call-the-function-that-in-the-timeline/214940>\
**Category:** flash\
**Created:** [February 2, 2007, 5:10am UTC](https://forum.kirupa.com/t/as2-is-it-possible-the-class-can-call-the-function-that-in-the-timeline/214940 "2007-02-02T05:10:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![siuj](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@siuj](https://forum.kirupa.com/u/siuj)\
**Post date:** [February 2, 2007, 5:10am UTC](https://forum.kirupa.com/t/as2-is-it-possible-the-class-can-call-the-function-that-in-the-timeline/214940/1 "2007-02-02T05:10:52Z")

</div>

Is it possible the class can call the function that in the timeline?

coz I want to use freetransform actionscript to apply “myMovie” class function …  
but the error msg: **Error There is no method with the name ‘addFreeTransform’.**

Thanks for help…

in myMovie.as

```auto

class myMovie extends MovieClip{
    
    static var EmptyMovieNum:Number=0;
    
    function EmptyMovie()
    {
        EmptyMovieNum++;
    }
    
    static function getMovieNum():Number
    {
        var A:Number = EmptyMovieNum;
        return A;
    }
    
    static function setMovieNum(A:Number)
    {
        EmptyMovieNum = A;
    }
    
    function onPress():Void
    {
        this.addFreeTransform(mystyle);
    }

```

in my FLA file, same as [http://www.senocular.com/flash/actionscript.php?file=ActionScript\_1.0/Prototypes/MovieClip/FreeTransform.as](http://www.senocular.com/flash/actionscript.php?file=ActionScript_1.0/Prototypes/MovieClip/FreeTransform.as)

```auto

FreeTransformStyle = function(linestyle, fillstyle, layout, autoRaise, autoRemove, sizeRestrict){
    if (linestyle != undefined) this.linestyle = linestyle;
    if (fillstyle != undefined) this.fillstyle = fillstyle;
    if (layout != undefined) this.layout = layout;
    if (autoRaise != undefined) this.autoRaise = autoRaise;
    if (autoRemove != undefined) this.autoRemove = autoRemove;
    if (sizeRestrict != undefined) this.sizeRestrict = sizeRestrict;
    this._freetransforms = [];
    this._arms = [];    
    return this;
}
FreeTransformStyle.prototype.linestyle = [0,0x000000,100];

....
(skip)
....

MovieClip.prototype.addFreeTransform = function(style){
    if (this._FTobject) this.removeFreeTransform();
    this._FTobject = new FreeTransform(this,style);
}

```
