Old 11-07-2008   #16 (permalink)
Just unleashed!
 
unleash's Avatar
 
Pinboliada Champion! Tournaments Won: 1

Join Date: Jul 2005
Location: Inbetween
Posts: 2,630
Blog Entries: 10
Images: 20

Battle Wins: 1 (rank: #35)
So here is the code,

Im rerunning some test, and recoding some parts But I f you can, please take a look synthetic... and when you find the flaw, explain it not only to stiney but to me as wel

So this is my setup:
I have an empty mc, in the left-top corner that is labelled "container". I also mention an "preloader1" variable in my code, this is a mc consisting of a big bar (the outer ring) and an bar (preloader1.preload_mask) that will fill up the outer ring....

Frame 1 : Startup and preloading
Code:
stop();
var p = 0;
trace (p)
function loadXML(loaded) {

	if (loaded) {

		xmlNode = this.firstChild;
		image = [];
		description = [];
		totali = xmlNode.childNodes.length;
		for (i=0; i<totali; i++) {

			image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
			description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;

		}
		Preloading();

	} else {

		content = "file not loaded!";

	}

}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");

function Preloading() {
	trace(image[p])
	var pic = image[0];
	trace(pic)
	container._alpha = 0;
	container.loadMovie(image[p]);
	preloader();
}
function preloader() {
	total = container.getBytesTotal();
	loaded = container.getBytesLoaded();
	if (loaded != total) {
		preloader1._visible = true;
		preloader1.preload_mask._xscale = 100*loaded/filesize;
	} else {
		if (p<totali) {
			p++;
			Preloading();
		} else {
			p = 0;
			preloader1._visible = false;
			container._alpha = 100;
			gotoAndPlay(2);
		}
	}
}
Frame 2 : actual 360 presentation
Code:
stop();
delay = 500;
this.onEnterFrame = function() {
	slideshow();
};
function slideshow() {
	MyInterval = setInterval(slide, delay);
	function slide() {
		clearInterval(MyInterval);
		if (p<totali) {
			nextslide();
		} else {
			slide0();
		}
	}
}
function nextslide() {
	container.loadMovie(image[p]);
	slideshow();
}
function slide0() {
	container.loadMovie(image[0]);
	slideshow();
}
btn1.onPress = function() {
	gotoAndPlay(3);
};
Frame 3 : Optional thumbnail thing ( not included in code)

Edit: I forgot to tell you, all this code is AS 2.0......
__________________
Ads are the cave art of the twentieth century.

That what doesn't destroy us, makes us stronger.
unleash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 11-07-2008   #17 (permalink)
MacAddict
 
synthetic's Avatar
 

Join Date: Dec 2006
Location: Ohio
Posts: 1,358
Blog Entries: 18
Images: 195

Battle Wins: 3 (rank: #12)
to be honest Unleash... I am more a designer than programmer so I work more visually in Flash and just looking at the code and not seeing the errors... I can't pick out what's wrong

I am going to grocery but when I get back... I will try to create it from scratch. I rely on simple frame actions to do most of the work and have a couple different ways to add the preloader with samples that were made already. Shouldn't take that long.
__________________
-Dean aka Synthetic Tone

My FeaturePics Pics | My Dreamstime Pics | My Photoblog
synthetic is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 11-08-2008   #18 (permalink)
Just unleashed!
 
unleash's Avatar
 
Pinboliada Champion! Tournaments Won: 1

Join Date: Jul 2005
Location: Inbetween
Posts: 2,630
Blog Entries: 10
Images: 20

Battle Wins: 1 (rank: #35)
alright, I really have to go and sleep now

And I still haven't found the problem, the thing is it is not loading in the images....

The XML is parsed, the array is filled up with the right images, but the "loadMovie();" just doesn't work properly :s

Hmm, I will have another go with it somewhere tomorrow, I may be able to fix it for you then
__________________
Ads are the cave art of the twentieth century.

That what doesn't destroy us, makes us stronger.
unleash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 11-09-2008   #19 (permalink)
Just unleashed!
 
unleash's Avatar
 
Pinboliada Champion! Tournaments Won: 1

Join Date: Jul 2005
Location: Inbetween
Posts: 2,630
Blog Entries: 10
Images: 20

Battle Wins: 1 (rank: #35)
Allright, I a took a second look at it today ( I just started from scratch).

and this is the part that works:

Code:
stop();
var delay = 200;
btn5.onPress = function() {
	clearInterval(myInterval);
	gotoAndPlay(2);
};
//////////Gallery functions////////////////////////////////
//XML////////////////////////////////////////////
function loadXML(loaded) {

	if (loaded) {

		xmlNode = this.firstChild;
		image = [];
		total = xmlNode.childNodes.length;
		for (i=0; i<total; i++) {

			image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;

		}
		slide();

	} else {

		content = "file not loaded!";

	}

}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
p = 0;

//preloader//////////////////////////////////////
this.onEnterFrame = function() {

	filesize = container.getBytesTotal();
	loaded = container.getBytesLoaded();
	preloader._visible = true;
	if (loaded != filesize) {

		preloader.preload_mask._xscale = 100*loaded/filesize;

	} else {

		preloader._visible = false;
		if (container._alpha<100) {

			container._alpha += 10;

		}

	}

};

//Slideshow functions////////////////////////////////
function slide() {
	if (loaded_bytes == loaded_total) {
		container.loadMovie(image[p]);
		slideshow();
	}
}
function slideshow() {
	myInterval = setInterval(slideOn, 250);
	trace(myInterval);
	function slideOn() {
		clearInterval(myInterval);
		nextImage();
	}
}
function nextImage() {
	if (p<(total-1)) {
		p++;
		slide();
	} else {
		p = 0;
		slide();
	}
}

//SlideBar functions/////////////////////////////
btn1.onPress = function() {
	clearInterval(myInterval);
	previousDia();
};

btn2.onPress = function() {
	clearInterval(myInterval);
	nextDia();
};
btn3.onPress = function() {
	clearInterval(myInterval);
	slide();
};

function previousDia() {
	if (p>0) {
		p--;
		container.loadMovie(image[p]);
	} else {
		p = total;
	}
}
function nextDia() {
	if (p<(total)) {
		p++;
		container.loadMovie(image[p]);
	} else {
		p = 0;
	}
}
This is the part that makes it a slideshow, there is also the function that can become the slidebar thing, and a button that makes it resume the presentation....

Ow and just after the XML loading part, there is a standart preloader (loads every single images apart when it is being loaded into the file (so not all together)...I have to change that somehow

PS: I have attached the "fla" file, I made it in CS3 so I am not sure if you can open it
Attached Files
File Type: zip 360 presentation.zip (6.6 KB, 5 views)
__________________
Ads are the cave art of the twentieth century.

That what doesn't destroy us, makes us stronger.
unleash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 11-10-2008   #20 (permalink)
Just unleashed!
 
unleash's Avatar
 
Pinboliada Champion! Tournaments Won: 1

Join Date: Jul 2005
Location: Inbetween
Posts: 2,630
Blog Entries: 10
Images: 20

Battle Wins: 1 (rank: #35)
Succes!

I think I succeeded,

the code isnt completely finished (yet) but the biggest part is done. The graphics also need some work but that can be done at a later stage....

so this is the code:
frame1 preloading and XML parsing :
Code:
stop();
btn1._visible = false;
btn2._visible = false;
btn3_1._visible = false;
btn3_2._visible = false;
btn4._visible = false;
btn5._visible = false;
txt_rot._visible = false;
container._alpha = 0;
p = 0;
//XML////////////////////////////////////////////
function loadXML(loaded) {

	if (loaded) {

		xmlNode = this.firstChild;
		image = [];
		total = xmlNode.childNodes.length;
		for (i=0; i<total; i++) {

			image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;

		}
		preload();

	} else {

		content = "file not loaded!";

	}

}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("360view.xml");
/////////////////////////////////////
this.onEnterFrame = function() {
	filesize = container.getBytesTotal();
	bytesloaded = container.getBytesLoaded();
	if (bytesloaded != filesize) {
		preloader._visible = true;

		preloader.preloadermask._xscale = 100*bytesloaded/filesize;
		preloader_txt = 100*(bytesloaded/filesize)+"%";
		preloader_file = p+"/"+(total-1);

	} else {
		preloader._visible = false;
		

	}

};

function preload() {
	if (loaded_bytes == loaded_total) {
		container.loadMovie(image[p]);
		preload_slide();
	}
}
function preload_slide() {
	myInterval = setInterval(slideOn, 250);
	function slideOn() {
		clearInterval(myInterval);
		nextPreImage();
	}
}
function nextPreImage() {
	if (p<(total-1)) {
		p++;
		preload();
	} else {
		btn1._visible = false;
		btn2._visible = false;
		btn3_1._visible = false;
		btn3_2._visible = false;
		btn4._visible = false;
		btn5._visible = false;
		gotoAndPlay(2);

	}
}stop();
btn1._visible = false;
btn2._visible = false;
btn3_1._visible = false;
btn3_2._visible = false;
btn4._visible = false;
btn5._visible = false;
txt_rot._visible = false;
container._alpha = 0;
p = 0;
//XML////////////////////////////////////////////
function loadXML(loaded) {

	if (loaded) {

		xmlNode = this.firstChild;
		image = [];
		total = xmlNode.childNodes.length;
		for (i=0; i<total; i++) {

			image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;

		}
		preload();

	} else {

		content = "file not loaded!";

	}

}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("360view.xml");
/////////////////////////////////////
this.onEnterFrame = function() {
	filesize = container.getBytesTotal();
	bytesloaded = container.getBytesLoaded();
	if (bytesloaded != filesize) {
		preloader._visible = true;

		preloader.preloadermask._xscale = 100*bytesloaded/filesize;
		preloader_txt = 100*(bytesloaded/filesize)+"%";
		preloader_file = p+"/"+(total-1);

	} else {
		preloader._visible = false;
		

	}

};

function preload() {
	if (loaded_bytes == loaded_total) {
		container.loadMovie(image[p]);
		preload_slide();
	}
}
function preload_slide() {
	myInterval = setInterval(slideOn, 250);
	function slideOn() {
		clearInterval(myInterval);
		nextPreImage();
	}
}
function nextPreImage() {
	if (p<(total-1)) {
		p++;
		preload();
	} else {
		btn1._visible = false;
		btn2._visible = false;
		btn3_1._visible = false;
		btn3_2._visible = false;
		btn4._visible = false;
		btn5._visible = false;
		gotoAndPlay(2);

	}
}
Frame2 slideshow:
Code:
stop();
var delay = 250;
trace(total);
trace(image[p])

btn4._visible = true;
preloader._visible = false;
preloader_txt._visible = false;
preloader_file._visible = false;


p = 0;

//Slideshow functions////////////////////////////////
function slide() {
	container.loadMovie(image[p]);
	slideshow();

}
function slideshow() {
	myInterval = setInterval(slideOn, delay);
	function slideOn() {
		clearInterval(myInterval);
		nextImage();
	}
}
function nextImage() {
	if (p<(total-1)) {
		p++;
		slide();
	} else {
		p = 0;
		slide();
	}
}

//SlideBar functions/////////////////////////////
btn1.onPress = function() {
	clearInterval(myInterval);
	previousDia();
};

btn2.onPress = function() {
	clearInterval(myInterval);
	nextDia();
};
btn3_1.onPress = function() {
	clearInterval(myInterval);
	btn3_1._visible = false;
	btn3_2._visible = true;
};
btn3_2.onPress = function() {
	clearInterval(myInterval);
	btn3_1._visible = true;
	btn3_2._visible = false;
	slide();
};

function previousDia() {
	if (p>0) {
		p--;
		container.loadMovie(image[p]);
	} else {
		p = total-1;
	}
}
function nextDia() {
	if (p<(total-1)) {
		p++;
		container.loadMovie(image[p]);
	} else {
		p = 0;
	}
}

//general buttons////////////////////////////////
btn4.onPress = function() {
	p = 0;
	btn1._visible = true;
	btn2._visible = true;
	btn3_1._visible = true;
	btn3_2._visible = false;
	btn4._visible = false;
	btn5._visible = true;
	txt_rot._visible = true;
	container.loadMovie(image[0]);
	container._alpha = 100;
	slide();
};

btn5.onPress = function() {
	clearInterval(myInterval);
	gotoAndPlay(3);
};
Frame3 exit(when there is an error )
Code:
stop();
I attached the file, if you want to take a look at working check the following link:

http://members.lycos.nl/erikknippels...esentation.swf

The file contains the fla file + the images. the images need to be placed in a folder called "images" that is in the same folder as the fla file(where you save it). If this isnt clear tell me and I will try to explain.

PS: If you need a script that also scales and centers the images, let me know but that does mean you need a lot more of info in your XML file......
Attached Files
File Type: zip 360 succes.zip (310.6 KB, 6 views)
__________________
Ads are the cave art of the twentieth century.

That what doesn't destroy us, makes us stronger.
unleash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 11-10-2008   #21 (permalink)
Registered User
 
stiney51's Avatar
 

Join Date: May 2006
Location: Maine, USA
Posts: 656
Blog Entries: 16
Images: 7

Battle Wins: 3 (rank: #12)
Unleash/Synthetic thanks a lot for all the help on this. This should go a long way with helping me get through all this.
stiney51 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 11-10-2008   #22 (permalink)
MacAddict
 
synthetic's Avatar
 

Join Date: Dec 2006
Location: Ohio
Posts: 1,358
Blog Entries: 18
Images: 195

Battle Wins: 3 (rank: #12)
no need to thank me... Unleash did all the work... I was just backup
__________________
-Dean aka Synthetic Tone

My FeaturePics Pics | My Dreamstime Pics | My Photoblog
synthetic is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 11-10-2008   #23 (permalink)
Just unleashed!
 
unleash's Avatar
 
Pinboliada Champion! Tournaments Won: 1

Join Date: Jul 2005
Location: Inbetween
Posts: 2,630
Blog Entries: 10
Images: 20

Battle Wins: 1 (rank: #35)
Quote:
Originally Posted by synthetic View Post
no need to thank me... Unleash did all the work... I was just backup
Dont think like that, I dont need all the credit

Stiney: If you have a question about the code, just post it here and I think synthetic or I will post an answer Ow and if you dont mind, I will keep working on the code and graphics, and post it back here when it is completely done....

Maybe you can use the final script than as well.
__________________
Ads are the cave art of the twentieth century.

That what doesn't destroy us, makes us stronger.
unleash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
need a flash doing Hummingbird The Marketplace 2 04-05-2007 02:25 PM
[FLASH] Simple Flash Preloader Jacorre Tutorial Submission 3 01-22-2007 10:07 PM
flash meri jaan General Discussions 5 11-01-2005 03:24 AM
flash herczx Flash & Dynamic Media 2 05-05-2005 08:04 PM


All times are GMT +1. The time now is 07:23 AM.

Powered by vBulletin Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2

Design & Content © BioRUST 2008 :: PRIVACY STATEMENT :: LEGAL INFORMATION :: ADVERTISING MEDIA KIT