maneuver escribió:
el flash debugger cuando hay por ejemplo un IOErrorEvent te salta una ventana en el navegador..no te muestra eso..entonces postea el code.
nota: usa charles proxy para que veas si se esta llevando acabo la llamada del RSS al servidor.
Jonathan
Bueno Jonathan, me voy a fijar.
Y también voy a postear el código.
Código ActionScript :
var xml_feed: XML = new XML();
var xml_feed_URLLoader : URLLoader = new URLLoader();
function cargarXMLFeed ():void{
xml_feed_URLLoader.load(new URLRequest("http://www.sitio.com/blog/feed"));
xml_feed_URLLoader.addEventListener(Event.COMPLETE,mostrarFeed);
xml_feed_URLLoader.addEventListener(ProgressEvent.PROGRESS,txtCargando);
xml_feed_URLLoader.addEventListener(IOErrorEvent.IO_ERROR,errorAlCargarXML);
}
function txtCargando(e:ProgressEvent):void{
//trace(e.bytesTotal);
//trace(e.bytesLoaded);
//trace(e.bytesTotal);
}
function errorAlCargarXML(e:IOErrorEvent):void{
trace("Se produjo un error al cargar el archivo");
}
function mostrarFeed(e:Event):void{
xml_feed = XML(xml_feed_URLLoader.data);
//valor: Post 1
c_rssBlog.tit_uno.text = "<span class='tit'>"+ xml_feed.channel.item[0].title.text() +".</span>\n<span class='negro'> "+ fechaParseada( xml_feed.channel.item[0].pubDate.text() ) + "</span>";
var post_uno_raw:String = String(xml_feed.channel.item[0].description.text()).substr(0,205);
var split_uno:Array = (post_uno_raw.split("\n"));
c_rssBlog.post_uno.htmlText = split_uno[0]+"... <a href='"+xml_feed.channel.item[0].link.text()+"'>[ir al post]</a>";
//valor: Post 2
c_rssBlog.tit_dos.text = "<span class='tit'>"+ xml_feed.channel.item[1].title.text() +".</span>\n<span class='negro'> "+ fechaParseada( xml_feed.channel.item[1].pubDate.text() ) + "</span>";
var post_dos_raw:String = String(xml_feed.channel.item[1].description.text()).substr(0,205);
var split_dos:Array = (post_dos_raw.split("\n"));
c_rssBlog.post_dos.htmlText = split_dos[0]+"... <a href='"+xml_feed.channel.item[1].link.text()+"'>[ir al post]</a>";
}
function fechaParseada (str:String):String{
var contenedorFecha : String = "";
var spliteado:Array = (str.split(" "));
switch(spliteado[0]){
case 'Mon,':
contenedorFecha += "Lun ";
break;
case 'Thue,':
contenedorFecha += "Mar ";
break;
case 'Wed,':
contenedorFecha += "Mié ";
break;
case 'Thur,':
contenedorFecha += "Jue ";
break;
case 'Frid,':
contenedorFecha += "Vie ";
break;
case 'Sat,':
contenedorFecha += "Sáb ";
break;
case 'Sun,':
contenedorFecha += "Dom ";
break;
}
contenedorFecha += " "+spliteado[1]+ " de ";
switch(spliteado[2]){
case 'Jan':
contenedorFecha += "Ene de";
break;
case 'Feb':
contenedorFecha += "Feb de";
break;
case 'Mar':
contenedorFecha += "Mar de";
break;
case 'Apr':
contenedorFecha += "Abr de";
break;
case 'May':
contenedorFecha += "May de";
break;
case 'Jun':
contenedorFecha += "Jun de";
break;
case 'Jul':
contenedorFecha += "Jul de";
break;
case 'Aug':
contenedorFecha += "Ago de";
break;
case 'Sep':
contenedorFecha += "Sep de";
break;
case 'Oct':
contenedorFecha += "Oct de";
break;
case 'Nov':
contenedorFecha += "Nov de";
break;
case 'Dec':
contenedorFecha += "Dic de";
break;
}
contenedorFecha += " "+spliteado[3];
return contenedorFecha;
}
cargarXMLFeed();
, ahí está.
Saludos.