# Newbie:

**URL:** <https://forum.kirupa.com/t/newbie/139514>\
**Category:** Uncategorized\
**Created:** [March 3, 2005, 3:08pm UTC](https://forum.kirupa.com/t/newbie/139514 "2005-03-03T15:08:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xmac](https://avatars.discourse-cdn.com/v4/letter/x/dec6dc/32.png) [@xmac](https://forum.kirupa.com/u/xmac)\
**Post date:** [March 3, 2005, 3:08pm UTC](https://forum.kirupa.com/t/newbie/139514/1 "2005-03-03T15:08:44Z")

</div>

Hi everyone,

I’m trying to apply a fade-in effect to a jpeg that is being dynamically loaded into a movieclip. The problem is, the fade works only when I do a refresh in page. The first time it shows no fade, just the image.

Here’s the code I’m using:

```auto
fita.loadMovie ("img1.jpg");
 
fita._alpha = 0
this.onEnterFrame = function() {
if (fita._alpha <= 100) {
fita._alpha += 10;
}
};

preloader.onEnterFrame = function () {
	var loaded = fita.getBytesLoaded ();
	var total = fita.getBytesTotal ();
	var percent = Math.round((loaded/total)*100);
	if (loaded != total) {
		this._visible = true;
		//this.l1.text = Math.round (loaded/1000) + " kb";
		//this.t2.text = Math.round (total/1000) + "kb";
		this.p3.text = percent + "%";		 
 	} else {
		// fully loaded
		this._visible = false;
	}
};

```
