# Can you help me make my code more efficient?

**URL:** https://forum.kirupa.com/t/can-you-help-me-make-my-code-more-efficient/298086
**Category:** flash
**Created:** [October 13, 2009, 3:13pm UTC](https://forum.kirupa.com/t/can-you-help-me-make-my-code-more-efficient/298086 "2009-10-13T15:13:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![vixiehd](https://avatars.discourse-cdn.com/v4/letter/v/6f9a4e/32.png) [@vixiehd](https://forum.kirupa.com/u/vixiehd)
#### Post date: [October 13, 2009, 3:13pm UTC](https://forum.kirupa.com/t/can-you-help-me-make-my-code-more-efficient/298086/1 "2009-10-13T15:13:01Z")

</div>

Hi,

I’m using similar sections of code to the below throughout my site - but want it to be more efficient if possible. Can anyone please post me an example of how I could do this? I’d be very grateful 🙂

function fadeinweddingitems(event:Event):void  
{  
weddingstext\_mc.alpha += .05;  
brides\_mc.alpha += .05;  
weddingvideosbartext\_mc.alpha += .05;  
sampleweddingvideo1photodiscstext\_mc.alpha += .05;  
sampleweddingvideo1photodiscstext2\_mc.alpha += .05;

```
    if(weddingstext_mc.alpha &gt;= 1)
    {
        weddingstext_mc.alpha = 1;
        brides_mc.alpha = 1;
        weddingvideosbartext_mc.alpha = 1;
        sampleweddingvideo1photodiscstext_mc.alpha = 1;
        sampleweddingvideo1photodiscstext2_mc.alpha = 1;
                
        weddingstext_mc.removeEventListener(Event.ENTER_FRAME, fadeinweddingitems);
    }

```

}

Thanks in advance!
