# MovieClip.prototype Question

**URL:** https://forum.kirupa.com/t/movieclip-prototype-question/237454
**Category:** Uncategorized
**Created:** [August 30, 2007, 2:12pm UTC](https://forum.kirupa.com/t/movieclip-prototype-question/237454 "2007-08-30T14:12:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![this](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/this/32/669_2.png) [@this](https://forum.kirupa.com/u/this)
#### Post date: [August 30, 2007, 2:12pm UTC](https://forum.kirupa.com/t/movieclip-prototype-question/237454/1 "2007-08-30T14:12:39Z")

</div>

Im making one site and wanna create one prototype that load and do tween of alpha zero to alpha 100. Bellow my code:

```auto

// _________________________________________
// prototype
MovieClip.prototype.loading = function(file:String):Void {
    this.loadMovie(file);
    onEnterFrame = function() {
        var lfilet:Number = Math.round(this.getBytesTotal());
        var lfilel:Number = Math.round(this.getBytesLoaded());
        var lfilep:Number = int((lfilel/lfilet)*100);
        if ( lfilet > 4 && lfilep == 100 ) {
            this.alphaTo(100,1);
            delete onEnterFrame;
        } else {
            this._alpha = 0;
        };
    };
};
// _______________________________________
// usingIt
var perfBg:String = xml.childNodes[0].childNodes[0].attributes.bg;
conteudo.perfil.bg.foto.loading("imagens/" + perfBg);

```

After run it the image load normaly but dont show the fade. studing the code results i saw that error is the load variables (lfilet, lfilet and lfilep), the result of lfilet and lfilel always is the same. what can i do to resolve it or with this code create one classe ( i dont know nothing about develop classes, only how to use ).

tks in advance and waiting help.  
😛
