Old 07-24-2007   #1 (permalink)
Just unleashed!
 
unleash's Avatar
 
Join Date: Jul 2005
Location: Inbetween
Posts: 2,210
Blog Entries: 9

centering dynamicly loaded content

well, I'm trying to load images into an empty movie clip, this works out fine....
then this empty mc should be the center for the loaded images....

and that's my problem, the image will take the empty mc as its left top

can you guys help me out on this one?
__________________
"I haven't failed, I've just found out
10.000 ways that don't work."

~Thomas Edison~
unleash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 07-24-2007   #2 (permalink)
Just unleashed!
 
unleash's Avatar
 
Join Date: Jul 2005
Location: Inbetween
Posts: 2,210
Blog Entries: 9

that's done, whooot

No really that worked out pretty well, but maybe you can help me with something different, I have my finished flash scrip/ .swf but at the end of the cycle it generates an error. This error sais that flash needs to load something that isn't defined, wich is correct because after the fourth pic there isn't any other....still flash believes there is.

Now I can's find the answer/ problem on this one, so it would be great if you could check my code for me......

this is the code loading the XML doc into flash
Code:
stop();
//XML////////////////////////////////////////////
function loadXML(loaded) {
	if (loaded) {
		xmlNode = this.firstChild;
		dia = [];
		beschrijving = [];
		timer = [];
		xwidth = [];
		yheight = [];
		_global.total = xmlNode.childNodes.length;
		for (i=0; i<_global.total; i++) {
			dia[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
			beschrijving[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
			timer[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
			xwidth[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
			yheight[i] = xmlNode.childNodes[i].childNodes[4].firstChild.nodeValue;
		}
		gotoAndPlay(2);
	} else {}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("RWE slideshow.xml");
//var////////////////////////////////////////////

p = 0;
this is the code displaying the images/ switching between them
Code:
stop();
//variables//////////////////////////////////////
t = timer[p]*1000;
//preloader//////////////////////////////////////
loaded = Math.round(_root.getBytesLoaded());
filesize = Math.round(_root.getBytesTotal());
total_percent = (loaded/filesize)*100;
_root.loaded_txt = Math.round(total_percent);
if (loaded === filesize) {
	preloader._visible = false;
	preloader_txt._visible = false;
	beschrijving_mc._visible = true;
	beschrijving_txt._visible = true;
	preloader_bg._visible = false;
	if (beschrijving_logo._alpha<90) {
		beschrijving_logo._alpha += 10;
	}
	ID = setInterval(function () {
		gotoAndPlay(3);
	}, t);
	slide();
} else {
	preloader._visible = true;
	preloader_txt._visible = true;
	beschrijving_mc._visible = false;
	beschrijving_txt._visible = false;
	if (beschrijving_logo._alpha>0) {
		beschrijving_logo._alpha -= 10;
	}
	reloader_bg._visible = true;
}
//image switching////////////////////////////////////
mc_x = mc._x;
mc_y = mc._y;
mc_width = mc._xscale;
mc_height = mc._yscale;
function slide() {
	if (loaded_bytes == loaded_total) {
		mc.loadMovie(dia[p]);
		beschrijving_text = (beschrijving[p]);
		mc_x = mc._x;
		mc_y = mc._y;
		mc_width = xwidth[p]*(mc._xscale/100);
		mc_height = yheight[p]*(mc._yscale/100);
		scale();
		if (p !== _global.total) {
			p == p++;
		} else {
			p = 0;
		}
	}
}
function scale() {
	//variables/////////////////////////////////////
	total_width = 550;
	total_height = 400;
	mc_yscale = mc._yscale;
	mc_xscale = mc._xscale;
	mc_xw = mc_width/total_width;
	mc_yh = mc_height/total_height;
	//calculation///////////////////////////////////
	mc._yscale = mc_yscale/mc_yh;
	mc._xscale = mc_xscale/mc_xw;
	locate();
}
function locate() {
	mc_width = xwidth[p]*(mc._xscale/100);
	mc_height = yheight[p]*(mc._yscale/100);
	mc._x = mc_x-(mc_width/2);
	mc._y = mc_y-(mc_height/2);
}
then there is a bit of code here and there but that has nothing to do with the problem......(Oh and the interval gets cleared at the end of every cycle...)
__________________
"I haven't failed, I've just found out
10.000 ways that don't work."

~Thomas Edison~
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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Iframe and Expandable Content Boxes are evil ! ViciOuS HTML / PHP / ASP / JS 7 05-22-2005 07:32 AM
Interface Help! (posted from an email to Man1c Mog LimitLess HTML / PHP / ASP / JS 2 01-18-2004 07:23 AM


All times are GMT +1. The time now is 08:30 AM.
Content Relevant URLs by vBSEO 3.2.0

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