Skip to main content
Participant
March 22, 2007
Question

Please Help - Fade on load with preloader

  • March 22, 2007
  • 3 replies
  • 252 views
Hi All,

I am loading an external swf into an emply mc when a button is clicked. I have the movie fading in when the button is clicked by the following code on the button:

on(press){
import mx.transitions.Tween;
var alphaTween:Tween = new Tween(_root.loader_mc, "_alpha", null , 0, 100, 2, true);
}

This works great. My problem is, I would like to have a preloader run until the movie is loaded and THEN have the movie fade in. Any help on achieving this would be most appreciated.

Thanks,
Eric
This topic has been closed for replies.

3 replies

Participating Frequently
March 22, 2007
This is one of the possible ways to do



import mx.transitions.Tween;

var container:MovieClip = createEmptyMovieClip("loader_mc", getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);
mcLoader.loadClip("1.swf", container);

function onLoadInit(mc:MovieClip) {
var alphaTween:Tween = new Tween(_root.loader_mc, "_alpha", null , 0, 100, 2, true);
}
echmrrAuthor
Participant
March 22, 2007
Thanks for the response. I am not sure where to apply the code. Is it on the button, on the preloader_mc or somewhere else? Any additional help would be great!

Thanks,
Eric
Inspiring
March 22, 2007
listener.onLoadInit = function(){
your fade script;
}

that should work