# Working with Classes that extend MovieClip

**URL:** https://forum.kirupa.com/t/working-with-classes-that-extend-movieclip/276738
**Category:** flash
**Created:** [December 3, 2008, 5:59am UTC](https://forum.kirupa.com/t/working-with-classes-that-extend-movieclip/276738 "2008-12-03T05:59:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![firedraco](https://avatars.discourse-cdn.com/v4/letter/f/7bcc69/32.png) [@firedraco](https://forum.kirupa.com/u/firedraco)
#### Post date: [December 3, 2008, 5:59am UTC](https://forum.kirupa.com/t/working-with-classes-that-extend-movieclip/276738/1 "2008-12-03T05:59:49Z")

</div>

Ok, I have a class called Ship that includes all the data I need for my Movieclips…and I also have a class called Pilot that contains a variable of type Ship. I have a button that creates a movieclip like this:

```auto
attachMovie("basic_ship", "player_ship", 10000);
    var Player:Pilot = new Pilot(Name_Input.text, 0, 150, player_ship);
    Player.Get_Ship()._x = 100;
    Player.Get_Ship()._y = 100;
    Player.Get_Ship().onEnterFrame = function () {
        if(Key.isDown(Key.UP) && !Key.isDown(Key.DOWN)) {
            this.Change_Cur_Speed(0.01*this.Get_Max_Speed());
        } else if(Key.isDown(Key.DOWN) && !Key.isDown(Key.UP)) {
            this.Change_Cur_Speed(-0.01*this.Get_Max_Speed());
        }
        if(Key.isDown(Key.LEFT) && !Key.isDown(Key.RIGHT)) {
            this._rotation += (this.Get_Max_Speed()/2);
        } else if(Key.isDown(Key.RIGHT) && !Key.isDown(Key.LEFT)) {
            this._rotation -= (this.Get_Max_Speed()/2);
        }
        this._x += this.Get_Cur_Speed()*Math.sin(this._rotation);
        this._y += this.Get_Cur_Speed()*Math.cos(this._rotation);
    }

```

The modification of the Ship’s .\_x and .\_y works fine…but the modification of the onEnterFrame() doesn’t work…is there something that I am doing wrong?
