Salve a tutti, nel famoso libro che si sfoglia (quello di http://www.pixelwit.com) vorrei inserire nell'ultima pagina un guestbook in php + xml. Ovviamente ho il solito problema dei livelli (che non capirò mai )per permettere di visualizzare il contenuto dell'xml. Vi chiederei un attimo di pazienza per aiutarmi.
Allora sul frame principale c'è un mc (libro) in cui si caricano altri mc che sarebbero le singole pagine. In particolare la pagina in cui ho inserito il guestbook è il mc che si chiama Print15.
Il codice che mi carica l'xml è questo:
codice:
var currPage = 0;
var showAmount = 10;			// set this to the amount of entries you want to view at a time
previous._visible = false;
createMessage._visible = false;
createButton.onRelease = function(){
	this._visible = false;
	this._parent.createMessage._visible = true;
	if (createMessage.nameField.text == ""){
		Selection.setFocus(createMessage.nameField);
	}
	else if (createMessage.emailField.text == ""){
		Selection.setFocus(createMessage.emailField);
	}
	else if (createMessage.messageField.text == ""){
		Selection.setFocus(createMessage.messageField);
	}
}

// **** Load XML ****************************
myXML = new XML();
myXML.ignoreWhite = true;
receiverXML = new XML();

myXML.onLoad = function(success){
	myXML.contentType = "text/xml";
	if (success){
		this.showXML();
	}
	else{
		trace("Errore caricamento file XML");
	}
}
myIdentifier=Math.round(Math.random()*10000);
myXML.load("guestbook.xml?uniq="+myIdentifier);

receiverXML.onLoad = function(){
	this.contentType = "text/xml";
	_root.currPage = 0;
	this.showXML();
}
createMessage.closeButton.onRelease = function(){
	this._parent._visible = false;
	createButton._visible = true;
}
createMessage.sendButton.onRelease = function(){
	var myName = this._parent.nameField.text;
	var myEmail = this._parent.emailField.text;
	var myMessage = this._parent.messageField.text;	
	if (myName == ""){
		this._parent.errorField.text = "inserisci il tuo nome";
		Selection.setFocus(this._parent.nameField);		
	}
	else if (myEmail == ""){
		this._parent.errorField.text = "inserisci la tua email";
		Selection.setFocus(this._parent.emailField);
	}
	else if (myMessage == ""){
		this._parent.errorField.text = "inserisci il messaggio";
		Selection.setFocus(this._parent.messageField);
	}
	else {
		myXML.firstChild.appendChild(myXML.createElement("entry"));
		myXML.firstChild.lastChild.attributes.myName = myName;
		myXML.firstChild.lastChild.attributes.myEmail = myEmail;
		myXML.firstChild.lastChild.appendChild(myXML.createElement("myText"));
		myXML.firstChild.lastChild.lastChild.appendChild(myXML.createTextNode(myMessage));
		myXML.sendAndLoad("processXML.php", receiverXML);
		this._parent._visible = false;
		createButton._visible = true;
	}
}
XML.prototype.showXML = function(){
	myGuestbook.scroll = 1;
	myGuestbook.htmlText = "";
	var numItems = this.firstChild.childNodes.length;
	var firstItem = numItems - (currPage*showAmount);		
	if (currPage == 0) previous._visible = false;
	var lastItem = firstItem - showAmount ;
	if (lastItem<=0) {
		lastItem = 0;
		next._visible = false;
	}
	myCount.text = "Messaggi totali: " + numItems;
	if (firstItem == lastItem+1) nowShowing.text = "Messaggio " + firstItem;
	else nowShowing.text = "Messaggio " + firstItem + " di " + (lastItem + 1);
	for (i=(firstItem-1); i>= lastItem; i--){
		myGuestbook.htmlText += "<FONT COLOR='#5F624D'>* </FONT><FONT COLOR='#000000'>Nome: </FONT><FONT COLOR='#000099'>" + this.firstChild.childNodes[i].attributes.myName + "</FONT>\n";
		myGuestbook.htmlText += "<FONT COLOR='#5F624D'>* </FONT><FONT COLOR='#000000'>Email: </FONT><FONT COLOR='#000099'>" + this.firstChild.childNodes[i].attributes.myEmail + "</FONT>\n<FONT COLOR='#FF0000'>\n Message::</FONT>\n";
		myGuestbook.htmlText +=  this.firstChild.childNodes[i].firstChild.firstChild.nodeValue + "\n............................................................\n";
	}
}
previous.onRelease = function(){	
	currPage--;
	myXML.showXML();
	next._visible = true;
}
next.onRelease = function(){	
	currPage++;
	myXML.showXML();
	previous._visible = true;
}
qualcuno può sistemarmelo in maniera tale da far funzionare il guestbook?? Vi ringrazio tantissimo