# Loading external jpg but alpha fade in doesnt work

**URL:** <https://forum.kirupa.com/t/loading-external-jpg-but-alpha-fade-in-doesnt-work/255753>\
**Category:** Uncategorized\
**Created:** [March 26, 2008, 4:00pm UTC](https://forum.kirupa.com/t/loading-external-jpg-but-alpha-fade-in-doesnt-work/255753 "2008-03-26T16:00:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe\_macloskey](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@joe\_macloskey](https://forum.kirupa.com/u/joe_macloskey)\
**Post date:** [March 26, 2008, 4:00pm UTC](https://forum.kirupa.com/t/loading-external-jpg-but-alpha-fade-in-doesnt-work/255753/1 "2008-03-26T16:00:50Z")

</div>

[COLOR=“Black”]Hi guy! im really new to all this action Script, im currently try to create an online portfolio [www.twentiseven.co.uk](http://www.twentiseven.co.uk) for my final year at uni. but the code below some how i did manage to get it work at first but when i put a preloader script in and its stop working.

all i want it that every jpg files loading into container\_mc to have a fade in alpha effect in it.

stop();  
[COLOR=“Red”]MovieClip.prototype.fadeIn = function() {  
this.onEnterFrame = function() {  
if (this.\_alpha\<100) {  
this.\_alpha += 10;  
} else {  
delete this.onEnterFrame;  
}  
};  
};[/COLOR]  
bar.\_visible = false;  
border.\_visible = false;

offthecuff\_mc = new MovieClipLoader();  
preload = new Object();  
offthecuff\_mc.addListener(preload);  
preload.onLoadStart = function(targetMC) {  
trace("started loading "+targetMC);  
offthecuff\_mc.\_alpha = 0;  
bar.\_visible = true;  
border.\_visible = true;  
pText.\_visible = true;  
};  
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {  
bar.\_width = (lBytes/tBytes)\*524;  
pText.text = “% “+Math.round((lBytes/tBytes)\*100);  
};  
preload.onLoadComplete = function(targetMC) {  
offthecuff\_mc.fadeIn();  
border.\_visible = false;  
bar.\_visible = false;  
dText.\_visible = false;  
trace(targetMC+” finished”);  
};  
//default image  
offthecuff\_mc.loadClip(“graphics/offthecuff.jpg”, “offthecuff\_mc”);

here is the site [www.twentiseven.co.uk](http://www.twentiseven.co.uk)[/COLOR]

Joe Macloskey
