# Add method to MovieClip

**URL:** <https://forum.kirupa.com/t/add-method-to-movieclip/254223>\
**Category:** Uncategorized\
**Created:** [March 9, 2008, 9:04pm UTC](https://forum.kirupa.com/t/add-method-to-movieclip/254223 "2008-03-09T21:04:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmilesp](https://avatars.discourse-cdn.com/v4/letter/b/3d9bf3/32.png) [@bmilesp](https://forum.kirupa.com/u/bmilesp)\
**Post date:** [March 9, 2008, 9:04pm UTC](https://forum.kirupa.com/t/add-method-to-movieclip/254223/1 "2008-03-09T21:04:35Z")

</div>

Hello, I’m trying to create a package so that when I import the package it will add a center\_to\_stage method to the movieclip. So i want to call it like this:

myClip.center\_to\_stage();

//here is the code (obviously it doesn’t work):

```auto
package bmilesp.display {
    
    import flash.display.MovieClip;
    import flash.display.Stage;
    
    public class MovieClip extends MovieClip(){
        
        public function center_to_stage():void{
            
            trace(this.name);
            
        }
    } 
}

```

any suggestions on how to do this right? thank you!
