hackig sida

Flash

0 svar · 260 visningar · startad av rille31

Medlem sedan okt. 2004186 inlägg
Trådstart#1

håller på med en liten sida i flash är jag laddar in 2xml filer och en CSS fil.
När jag exporterar filmen i flash MX 2004 blir den VÄLDIGT hackig, den hackar mindre i browsern men hackar väldigt mkt när jag testar i mx2004.
http://www.rille.net/limo/
tror att det beror på första inladdningen av xmlfilen
när första xmlfilen laddats in hoppar man till nästa frame där ett mc med scrollen laddar in nästa xml fil.

Vet inte om det beror på xmfilen eller koden
http://www.rille.net/limo/sections.xml

koden är simpel, jag laddar in xmlfilen sen fördelar jag den till diverse movieclips på scenen.
Kollar ven om scroll behövs för div textfält.

var currSection:MovieClip;
var nextSection:MovieClip;
var offPressed:Boolean;
var loadNext:Boolean;
var errorMsg:String = "There has been an error loading the requested information";
///////////////////////////////////////////////////////////////
function scrollCheck(path) {
	if (path.loadedInfo.maxscroll == path.loadedInfo.scroll) {
		path.scrollUp.enabled = false;
		path.scrollUp._alpha = 0;
		path.scrollDown.enabled = false;
		path.scrollDown._alpha = 0;
		path.scrollTrackbar.scrollBar.enabled = false;
		path.scrollTrackbar.scrollBar._alpha = 0;
	} else {
		path.scrollUp.enabled = true;
		path.scrollUp._alpha = 100;
		path.scrollDown.enabled = true;
		path.scrollDown._alpha = 100;
		path.scrollTrackbar.scrollBar.enabled = true;
		path.scrollTrackbar.scrollBar._alpha = 100;
	}
}
///////////////////////////////////////////////////////////////
//functions fot testimonials
var testimonials = new Array();
var currTestimonial:Number = 0;
var countFiles:Number;
function processTestimonials() {
	countFiles = sectionsXML.firstChild.childNodes[5].childNodes.length;
	for (var i = 0; i<countFiles; i++) {
		testimonials[i] = sectionsXML.firstChild.childNodes[5].childNodes[i].firstChild.nodeValue;
	}
}
//is called when testimonials loads
function updateImage() {
	if (currTestimonial == countFiles-1) {
		currTestimonial = 0;
	} else {
		currTestimonial++;
	}
}
///////////////////////////////////////////////////////////////
var sectionsXML:XML = new XML();
sectionsXML.ignoreWhite = true;
sectionsXML.onLoad = function(ok) {
	if (ok) {
		processTestimonials();
		//aboutsection
		about.aboutMc.loadedInfo.htmlText = sectionsXML.firstChild.childNodes[0].firstChild.nodeValue;
		about.aboutMc.textLoader._visible = false;
		scrollCheck(about.aboutMc);
		//links
		links.linksMc.loadedInfo.htmlText = sectionsXML.firstChild.childNodes[1].firstChild.nodeValue;
		links.linksMc.textLoader._visible = false;
		scrollCheck(links.linksMc);
		links.linksMc.container.loadMovie(this.firstChild.childNodes[1].attributes.webLink);
		//contact us
		contact.contactMc.loadedInfo.htmlText = sectionsXML.firstChild.childNodes[2].firstChild.nodeValue;
		contact.contactMc.textLoader._visible = false;
		scrollCheck(contact.contactMc);
		//airline
		airline.airlineMc.loadedInfo.htmlText = sectionsXML.firstChild.childNodes[3].firstChild.nodeValue;
		airline.airlineMc.textLoader._visible = false;
		scrollCheck(airline.airlineMc);
		//emploment
		emp.empMc.loadedInfo.htmlText = sectionsXML.firstChild.childNodes[4].firstChild.nodeValue;
		emp.empMc.textLoader._visible = false;
		scrollCheck(emp.empMc);
		play();
	} else {
		about.aboutMc.loadedInfo.htmlText = errorMsg;
		about.aboutMc.textLoader._visible = false;
		play();
	}
};
sectionsXML.load("sections.xml");
///////////////////////////////////////////////////////////////
var myCSS = new TextField.StyleSheet();
var cssURL = "stylesheet2.css";
//define onLoad handler
myCSS.onLoad = function(success) {
	if (success) {
		// attach style to textfields
		about.aboutMc.loadedInfo.styleSheet = myCSS;
		contact.contactMc.loadedInfo.styleSheet = myCSS;
		airline.airlineMc.loadedInfo.styleSheet = myCSS;
		links.linksMc.loadedInfo.styleSheet = myCSS;
		emp.empMc.loadedInfo.styleSheet = myCSS;
	}
};
//Load CSS file
myCSS.load(cssURL);
////////////////////////////////////////////////////////////
var sectionOff:Boolean;
function fadeMenu(clip) {
	clip.onEnterFrame = function() {
		clip._alpha += 2;
		if (clip._alpha>=100) {
			delete this.onEnterFrame;
		}
	};
}
stop();

vad kan det bero på, tacksam för all hjälp jag kan få :bire

361 ms totalt · 4 externa anrop · v20260731065814-full.d34c6d5a
118 ms — deklarationer (db)
116 ms — hämta statistik (db)
124 ms — hämta tråd, inlägg och bilagor (db)
117 ms — ändringar (db)