Foros del Web » Creando para Internet » Flash y Actionscript »

pedir un xml a un servidor para aplicacion air

Estas en el tema de pedir un xml a un servidor para aplicacion air en el foro de Flash y Actionscript en Foros del Web. estoy intentando crear una aplicacion(air) en base a una que hice para web pero no me muestra los datos que obtiene... genera_xml.php Código PHP: <? ...
  #1 (permalink)  
Antiguo 24/03/2010, 15:57
Avatar de superscully  
Fecha de Ingreso: febrero-2009
Mensajes: 56
Antigüedad: 15 años, 2 meses
Puntos: 0
Pregunta pedir un xml a un servidor para aplicacion air

estoy intentando crear una aplicacion(air) en base a una que hice para web pero no me muestra los datos que obtiene...

genera_xml.php
Código PHP:
<?
header
("Content-type: text/xml");
echo 
'<?xml version="1.0" encoding="ISO-8859-1"'.'?'.'>';
include(
"db_config.php");
// fechaf = year(now)&"/"&month(now)&"/"&day(now) & " " & formatdatetime(now,4)' & ":00" BUILD IN ASP

$fechadate("Y/j/d g:i:s").":00";

$sel="SELECT * FROM Notas WHERE NStatus = 1 AND NTipo = 1 AND NHome = 1 AND NFecha <= '".$fecha."' ORDER BY NFecha DESC LIMIT 5";
$rs=$c1->Execute($sel);

$max $rs->RecordCount();
$i=0;

echo 
'<noticias>';
while(!
$rs->EOF && $i $max){
    
$rs->Move($i);
    echo 
'<item>';
        echo 
'<fecha>'.$rs->fields("NFecha").'</fecha>';
        echo 
'<titulo>'.$rs->fields("NTitulo").'</titulo>';
        echo 
'<nota>'.$rs->fields("NCuerpo").'</nota>';
    echo 
'</item>';
$i++;
}
echo 
'</noticias>';
?>
main.mxml
Código:
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" 
	backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#FFFFFF, #FFFCFC]"
	 width="1168" height="670">

	 <mx:Script>
	 <![CDATA[
		import mx.controls.Alert;
		import mx.collections.ArrayCollection;
		import mx.rpc.events.ResultEvent;
		private function initApp():void
		{
			NotasPHP.send();
			
		}
		[Bindable]
		private var NoticiasData:ArrayCollection=new ArrayCollection();
		[Bindable]
		private var UltimasData:ArrayCollection=new ArrayCollection();
		
		private function noticiasInHandler(event:ResultEvent):void
		{
			var notRaw:ArrayCollection = event.result.noticias.item;
			
			for (var i:int=0;i < notRaw.length;i++)
			{
				var tempNot:Object = notRaw.getItemAt(i);
				NoticiasData.addItem(tempNot);
			} 	
			for (var j:int=0;i< 2;i++)
			{
				var temUlt:Object = notRaw.getItemAt(i);
				UltimasData.addItem(temUlt);
			}
		}
		
		
		
	]]>
	</mx:Script>


<mx:HTTPService id="NotasPHP" url="http://localhost/agencia/xml/genera_xml.php" result="noticiasInHandler(event)" showBusyCursor="true"/>


	<mx:Canvas x="0" y="169" width="200" height="499" backgroundColor="#FFFFFF" backgroundAlpha="0.7" horizontalScrollPolicy="off" verticalScrollPolicy="off">
		<mx:LinkButton x="54" y="30" label="Inicio" width="69" height="29"/>
	</mx:Canvas>
	<mx:Canvas width="966" height="499" x="200" y="169" id="principal">
		<mx:Canvas x="19" y="10" width="906" height="93" backgroundColor="#E7E6E6">
			<mx:Label x="0" y="0" text="Ultima Noticias" id="last_new" fontSize="12" width="906" kerning="true"/>
			<mx:Repeater id="lastNews" dataProvider="{UltimasData}">
				<mx:LinkButton id="LstNew" fontStyle="normal" fontFamily="times" color="#CFD3F9" label="{lastNews.currentItem.titulo}" y="29" width="290" height="64"/>
			</mx:Repeater>
		</mx:Canvas>
		</mx:Canvas>
	<mx:Style source="style.css"/>
	<mx:ApplicationControlBar x="0" y="0" width="{this.width}" height="170" id="AppBar" autoLayout="true">
		<mx:Image source="img/adminsup.png" width="{this.width}" height="145" scaleContent="true"/>
	</mx:ApplicationControlBar>
</mx:WindowedApplication>
espero que me puedan ayudar....

saludos
  #2 (permalink)  
Antiguo 25/03/2010, 09:57
Avatar de Sergestux  
Fecha de Ingreso: agosto-2007
Ubicación: Tapachula
Mensajes: 1.218
Antigüedad: 16 años, 8 meses
Puntos: 20
Respuesta: pedir un xml a un servidor para aplicacion air

O no busque bien o no veo donde llamas a la funcion initApp(), deberia ser al crearse la aplicacion supongo
  #3 (permalink)  
Antiguo 27/03/2010, 19:38
Avatar de eddwinpaz  
Fecha de Ingreso: noviembre-2007
Ubicación: Merida , Venezuela
Mensajes: 1.066
Antigüedad: 16 años, 5 meses
Puntos: 25
Respuesta: pedir un xml a un servidor para aplicacion air

http://blog.videoaprende.com/flex-y-xml/ MIRA ESTE VIDEO ESPERO QUE TE AYUDE..
__________________
O nos hacemos miserables o nos hacemos fuertes , la cantidad de trabajo es la misma.
  #4 (permalink)  
Antiguo 28/03/2010, 22:47
Avatar de superscully  
Fecha de Ingreso: febrero-2009
Mensajes: 56
Antigüedad: 15 años, 2 meses
Puntos: 0
Respuesta: pedir un xml a un servidor para aplicacion air

el unico problema era agregar:

Código:
creationComplete="initApp()"
muchas gracias por su tiempo...

Etiquetas: air, flex, pedir, xml, servidores, aplicaciones
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 11:10.