PDA

View Full Version : Dynamic JPG, preload and fade in.



as_clark20
September 9th, 2003, 05:35 AM
Hi everyone,

I'd like to have a jpg load into a movieclip, first display a preloader then fade the jpg in once its loaded. That would be super! Any ideas how I can do such a thing? I'm struggling because I suck at Flash but I've got to learn some time.

eki
September 9th, 2003, 09:12 AM
Hi,


init = function () {
this.myContainer = this.createEmptyMovieClip("cont", 1);
this.myContainer._alpha = 0;
this.myContainer.loadMovie("myPath/myJpg");
this.preloadJpg();
};
preloadJpg = function() {
this.onEnterFrame = function() {
if (this.myContainer.getBytesLoaded()>100 && this.myContainer.getBytesLoaded()>=this.myContainer.getBytesTotal()) {
this.fadePicIn();
}
};
};
fadePicIn = function() {
if(this.myContainer._alpha < 100){
this.myContainer._alpha += 10;
} else {
this.onEnterFrame = undefined;
}
}
this.init();




SHO

as_clark20
September 9th, 2003, 11:11 AM
Cheers very much,

you win Adams patented
FAVOURITE PERSON OF THE DAY award

eki
September 9th, 2003, 11:49 AM
Ta very much.
I'd like to dedicate this precious award to Felin, my Cat, who made possible this achievement by scratching the keyboard on my computer.

SHO

as_clark20
September 9th, 2003, 12:00 PM
For an extra 10 points or a date with my lovely sister....

how could I get a preloader to display on the same clip? I always see these fancy sights like pixelranger with preloaders and transition effects on dynamic jpg's and always wanted to do the same.

wetodit
September 10th, 2003, 08:34 AM
I would have thought someone would've jumped at the date with your sister!
I want to see the answer to your question as well! I'll throw in a free blockhead smiley to anyone who answers this... ;)
:block:

.zimone
January 21st, 2004, 03:42 AM
source :hair: (http://www.kirupa.com/developer/mx/preloader_transition.htm)
maybe that will be helpful

regards