# Simplyfing my code

**URL:** <https://forum.kirupa.com/t/simplyfing-my-code/238636>\
**Category:** Uncategorized\
**Created:** [September 13, 2007, 1:30pm UTC](https://forum.kirupa.com/t/simplyfing-my-code/238636 "2007-09-13T13:30:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lolomedia](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@lolomedia](https://forum.kirupa.com/u/lolomedia)\
**Post date:** [September 13, 2007, 1:30pm UTC](https://forum.kirupa.com/t/simplyfing-my-code/238636/1 "2007-09-13T13:30:44Z")

</div>

hello everyone…

how can i make this shorter…

```auto

my_mc1.onRelease = function (){
    _root.currentItem1.swapDepths (300);
    _root.currentItem1.removeMovieClip();
    _root.currentItem1 = _root.middleStage.attachMovie("audio1", "audio1", 1);
}

my_mc2.onRelease = function (){
    _root.currentItem1.swapDepths (300);
    _root.currentItem1.removeMovieClip();
    _root.currentItem1 = _root.middleStage.attachMovie("audio2", "audio2", 1);
}

my_mc3.onRelease = function (){
    _root.currentItem1.swapDepths (300);
    _root.currentItem1.removeMovieClip();
    _root.currentItem1 = _root.middleStage.attachMovie("audio3", "audio3", 1);
}
my_mc4.onRelease = function (){
    _root.currentItem1.swapDepths (300);
    _root.currentItem1.removeMovieClip();
    _root.currentItem1 = _root.middleStage.attachMovie("audio4", "audio4", 1);
}

```

please advice.

thanks.
