# Extending MovieClip functionality

**URL:** https://forum.kirupa.com/t/extending-movieclip-functionality/286276
**Category:** flash
**Created:** [April 13, 2009, 8:33am UTC](https://forum.kirupa.com/t/extending-movieclip-functionality/286276 "2009-04-13T08:33:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![riveroaks](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@riveroaks](https://forum.kirupa.com/u/riveroaks)
#### Post date: [April 13, 2009, 8:33am UTC](https://forum.kirupa.com/t/extending-movieclip-functionality/286276/1 "2009-04-13T08:33:11Z")

</div>

So in my current project I am often extending MovieClip to get full visual functionality such as interaction with the display list.

Now in many of these cases my objects are resizable and upon a resize I want to change various things so that my object remains in the correct proportions. Now actionscript changes properties by saying things like:

myObj.width = 100.

I’m having 2 problems with this. First, I can’t override that behavior to allow my own code to run based on a new width because width is a property, not a method. I suppose I could attach a listener to my object within itself and then run whatever I want when the width changes, but is there a more direct way of adding behavior when something like width, or an x and y value are changed?

Second, when you change the width of a MovieClip it starts skewing things. I definitely do not want the stuff inside my objects to get skewed, is there a way to prevent this?

So basically I’m trying to get myObj.width = 100 to run something of my choosing to make the new width 100.

Thanks.
