# Shortening a Script

**URL:** <https://forum.kirupa.com/t/shortening-a-script/95856>\
**Category:** Uncategorized\
**Created:** [December 1, 2003, 9:03pm UTC](https://forum.kirupa.com/t/shortening-a-script/95856 "2003-12-01T21:03:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jasonargo](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@Jasonargo](https://forum.kirupa.com/u/Jasonargo)\
**Post date:** [December 1, 2003, 9:03pm UTC](https://forum.kirupa.com/t/shortening-a-script/95856/1 "2003-12-01T21:03:32Z")

</div>

Is the away to create functions and apply it to movie clips for example, if I have four movie clips home, visit, products, contact us how could I when I rollover home make it enlarge and the others get smaller and fade slightly. this is the code I have now.  
Say I write  
enlarge = function () {  
this.\_xscale = 200;  
this.\_yscale = 200;  
};  
and  
shirnk = function () {  
this.\_xscale = 50;  
this.\_yscale = 50;  
this.\_alpha =25;  
};  
how would I apply it to the script below to shorten it.

home.onRollOver = function() {  
this.\_xscale = 200;  
this.\_yscale = 200;  
visit.\_xscale = 50;  
visit.\_yscale = 50;  
visit.\_alpha = 25;  
products.\_xscale = 50;  
products.\_yscale = 50;  
products.\_alpha = 25;  
contact.\_xscale = 50;  
contact.\_yscale = 50;  
contact.\_alpha = 25;  
};  
home.onRollOut = function() {  
this.\_xscale = 100;  
this.\_yscale = 100;  
visit.\_xscale = 100;  
visit.\_yscale = 100;  
visit.\_alpha = 100;  
products.\_xscale = 100;  
products.\_yscale = 100;  
products.\_alpha = 100;  
contact.\_xscale = 100;  
contact.\_yscale = 100;  
contact.\_alpha = 100;  
};
