Comunidad de diseño web y desarrollo en internet online

Crear generador de noticias en flash que se puedan modificar

Citar            
MensajeEscrito el 04 Sep 2008 09:08 am
Crear tablón o generador de noticias en flash que se puedan crear, modificar y borrar mediante php, sql , as, xml desde administrador

En primer lugar saludos a todos, ya que soy nuevo en el foro

Se que se cree que se ha hablado de esto pero sinceramente le he dado mil y una vueltas y esto no esta completo .. Yo soy diseñador flash y mis conocimientos de programación son cortitos, estoy intentando empaparme de todo pero estoy limitado

Hace unos días cree una web donde tiene un apartado de noticias que carga un xml mediante php pudiendo crear todas las noticias nuevas que quisiera …
Asta hay genial ¡
Lo q me esta quitando el sueño es que quiero poder modificar dichas noticias ampliarlas o borrarlas desde el espacio de administrador no se como hacerlo no se si con el xml puedo hacerlo o tendría que coger otro formato y si es así como lo enlazo a el flash que contiene mi pagina?

Archivos actuales :
Flash: que contiene la pelicula y el espacio administrador + recojida de datos

//AactionScript 2

System.useCodepage = true;
var currPage = 0;
var showAmount = 10;
// cantidad de entradas que desea ver a la vez
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.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("Error lectura XML file");
}
};
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 myMessage = this._parent.messageField.text;
if (myName == "") {
this._parent.errorField.text = "falta titulo";
Selection.setFocus(this._parent.nameField);
} else if (myMessage == "") {
this._parent.errorField.text = "falta contenido";
Selection.setFocus(this._parent.messageField);
} else {
myXML.firstChild.appendChild(myXML.createElement("entry"));
myXML.firstChild.lastChild.attributes.myName = myName;
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 = numItems+" Noticias: ";
if (firstItem == lastItem+1) {
nowShowing.text = "Noticias Mostradas "+firstItem;
} else {
nowShowing.text = "Noticias Mostradas "+firstItem+" to "+(lastItem+1);
}
for (i=(firstItem-1); i>=lastItem; i--) {
myGuestbook.htmlText += "<B>"+this.firstChild.childNodes[i].attributes.myName+"</B> \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;
};

Archivo php : (processXML.php)
tipo guestbook que hace de enlace o motor del xml a flash


//codigo

<?php
$file = fopen("guestbook.xml", "w+") or die("Can't open XML file");
$xmlString = $HTTP_RAW_POST_DATA;
if(!fwrite($file, $xmlString)){
print "Error writing to XML-file";
}
print $xmlString."\n";
fclose($file);
?>

Archivo xml( guestbook.xml)

//codigo

<?xml version="1.0"?><guestbook><entry myName=""><myText>. </myText></entry></guestbook>

Por YAYSER

0 de clabLevel



 

españa

firefox
Citar            
MensajeEscrito el 04 Sep 2008 10:20 am
Con muchas líneas de código y sin formato no puedo leer la forma en que lo haces, pero atendiendo a lo que deseas lo más óptimo es que tengas todo en una base de datos y que lo que leas sea un php que tome los datos de la base y te devuelva un XML, así de esta forma podrías actualizar o añadir datos de manera más fácil. Sólo te haría falta un php para crear el XML, en el foro de php puedes hacer un post al respecto.

Por elchininet

Claber

3921 de clabLevel

17 tutoriales

Genero:Masculino  

Front-end developer at Booking.com

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.