Bizarre results when trying crossfade of swfs in flash

Specific Q&A about the new Flash export
Locked
jcg31
Posts: 3
Joined: Sun Jan 06, 2008 3:55 am

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);
	}
};
User avatar
thomas
Chief Gnome
Posts: 2611
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

jcg31 wrote: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?
Yes, this is correct. With Flash 8 you can not load more than one panorama at the same time because of havy usage of a static class. I tried other designs without that static class but all failed. In some cases the panorama slowed down by 50% in others the message handling failed.
Because of the much better design of ActionScript 3 it should be possible with Flash 9. Here is everything encapsulated within one class (and several helper classes) and no static class is needed.

Additional Note:
According to the latest statistics from Adobe (http://www.adobe.com/products/player_ce ... ation.html) Flash 8 has only a 3% higher reach than Flash 9 and Flash 9 is at least twice as fast rendering panoramas. I thing it doesn't make sense to develop something for Flash 8 anymore.
MfG, Thomas
jcg31
Posts: 3
Joined: Sun Jan 06, 2008 3:55 am

Thomas,
Has there been any update that would allow multiple panos to run with flash to facilitate cross fades?
Thanks,
Jim
User avatar
thomas
Chief Gnome
Posts: 2611
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

The Flash 8 export didn't get an update will stay the way it is because now Flash 8 is down to 0.5% percent. There is no real reason to stick with Flash 8. The cross fade should work with Pano2VR/Flash 9 export.
MfG, Thomas
Locked