Bizarre results when trying crossfade of swfs in flash
Posted: Sun Jan 06, 2008 11:26 pm
I think I misposted my initial crossfade question on another thread. Nontheless, what I am trying to accomplish in a slideshow is a seamless transition from one pano to the next without a flicker. I am continuing to go at this and where I have been successful in creating the crossfade I had to use two different loaders attached to two different empty movie clips. I know this is bizarre but I was trying anything. This (see code below) seemed promising at first, but when the second pano faded it, it was the file from the first positioned according to the parameters for the second. This despite the fact that I had confirmed via bits received that the second file loaded into the clip successfully. Where I seem to be heading is that it is not possible for two panorama in swf created in pano2QTVR to coexist in the same main movie long enough to do the fade. Is this correct? Is there some global variable declared int he api that prevents this, or that would cause the file from the first clip to appear in the second?
Code: Select all
import mx.transitions.Tween;
import mx.transitions.easing.*;
//***********************************************************Dome MC setup
var Dome:MovieClip = _root.createEmptyMovieClip("Dome", 0);
Dome._lockroot = true;
var myLoader = new MovieClipLoader();
var myListener = new Object();
myLoader.addListener(myListener);
//************************************************************Arch MC setup
var Arch:MovieClip = _root.createEmptyMovieClip("Arch", 1);
Arch._lockroot = true;
var myLoader2 = new MovieClipLoader();
var myListener2 = new Object();
myLoader2.addListener(myListener2);
//************************************************************Loading Dome
myLoader.loadClip("http://www.jcgleim.com/smalldome.swf", Dome);
//************************************************************Setting up MC properties
myListener.onLoadStart = function() {
_root.Dome.window_width = 160;
_root.Dome.window_height = 100;
_root.Dome.window_x = 10;
_root.Dome.window_y = 10;
Dome.pan = 160;
Dome.tilt = 10;
};
//*************************************************************Wait for Dome to load completely and then load Arch
myListener.onLoadInit = function() {
trace("loadinit");
var tween_handler:Object = new Tween(Dome, "_alpha", Strong.easeIn, 0, 100, 2, true);
tween_handler.onMotionFinished = function() {
myLoader2.loadClip("http://www.jcgleim.com/smallarch.swf", Arch);
var tween_handler4:Object = new Tween(Arch, "_alpha", Strong.easeIn, 0, 100, 3, true);
};
};
//*************************************************************Verify that different files were loaded in this case Dome
myListener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
trace(bytesLoaded);
if (bytesLoaded == bytesTotal) {
trace("Dome = "+bytesLoaded);
}
};
//*************************************************************Setting up Arch Properties
myListener2.onLoadStart = function() {
//Dome.removeMovieClip()
_root.Arch.window_width = 160;
_root.Arch.window_height = 100;
_root.Arch.window_x = 10;
_root.Arch.window_y = 10;
Arch.pan = 230;
Arch.tilt = 10;
};
//*************************************************************Verify that different files were loaded in this case Arch
myListener2.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
trace(bytesLoaded);
if (bytesLoaded == bytesTotal) {
trace("Arch = "+bytesLoaded);
}
};