Advertisement

03.06.2008 at 07:19AM PST, ID: 23219777
[x]
Attachment Details

Adobe, Flash, CS3, onEnterFrame Alpha fade in/out for XML slideshow

Asked by razn8 in Macromedia Flash, Extensible Markup Language (XML)

Tags: Adobe, Flash, CS3, onEnterFrame Alpha fade

This is a three part question
1. I have an XML slideshow that I need to to add a fade in/out between images. I understand that I need to add an Alpha function to the onEnterFrame event, but I can't figure out the correct syntax to implement it into my current actionscript code. I've attached my actionscript code for imageLoader1.

2. This particular slideshow has two individual imageLoaders referencing two separate XML files, each with their own loading bar. I can get the imageLoader1 loading bar to work, but not imageLoader2. Here is a link to a zip file of the project:
http://advancedmediaproduction.com/wp-content/staging/dual-slideshow.zip

3. Is using two separate XML files (one for each imageLoader) appropriate, or would combining them into one XML file be a better practice? If so, what is the best method?

Thanks Much!Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
var img_xml = new XML()
img_xml.ignoreWhite = true;
img_xml.load("images.xml");
var imgArray = new Array();
						 
img_xml.onLoad = function()
{
	var slideTimer:Number = Number(img_xml.firstChild.firstChild.attributes.time);
	for (i = 1; i < img_xml.firstChild.childNodes.length; i++)
	{
		_root.imgArray[i - 1] = img_xml.firstChild.childNodes[i].attributes.path;
	}
	
	imgLoader.load( _root.imgArray[0] );
	
	setInterval(nextImage, slideTimer);
 
}
 
var curImage = 0;
 
 
_root.onEnterFrame = function()
{
	if (imgLoader.percentLoaded != 100)
	{
		Bar._visible = 1
		Bar._xscale = imgLoader.percentLoaded
	}
	else
	{
		Bar._visible = 0
	}
	
}
 
function nextImage()
{
	_root.curImage++
	if (_root.curImage == _root.imgArray.length)
	{
		_root.curImage = 0;
	}
	
	_root.imgLoader.load( _root.imgArray[curImage] );
		
}
[+][-]03.06.2008 at 08:07AM PST, ID: 21061618

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.06.2008 at 08:09AM PST, ID: 21061636

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.14.2008 at 10:50AM PDT, ID: 21127690

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.14.2008 at 11:21AM PDT, ID: 21128005

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.16.2008 at 11:24AM PDT, ID: 21137843

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Macromedia Flash, Extensible Markup Language (XML)
Tags: Adobe, Flash, CS3, onEnterFrame Alpha fade
Sign Up Now!
Solution Provided By: julianopolito
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628