# Scale function help

**URL:** <https://forum.kirupa.com/t/scale-function-help/40448>\
**Category:** Uncategorized\
**Created:** [January 18, 2004, 10:12pm UTC](https://forum.kirupa.com/t/scale-function-help/40448 "2004-01-18T22:12:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![markhegz](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@markhegz](https://forum.kirupa.com/u/markhegz)\
**Post date:** [January 18, 2004, 10:12pm UTC](https://forum.kirupa.com/t/scale-function-help/40448/1 "2004-01-18T22:12:15Z")

</div>

I am using the folowing as on a movie clip to scale it:  
[AS]onClipEvent(load){  
targe\_width = \_width;  
targe\_height = \_height;  
}  
onClipEvent(enterFrame){  
\_width = \_width += (targe\_width - \_width)/3.6  
\_height = \_height += (targe\_height - \_height)/3.6  
}[/AS]

this as works fine but i have 30 clips that i want to apply it too. how can i turn this into a function i.e  
[AS]function scale(targe\_width, targe\_height);  
[/AS]

so on each clip i can invoke the function by calling something like  
[AS] scale(50, 50); [/AS]

im sure its pretty easy does anyone have any ideas?
