Retroceder   Foros del Web > Diseño de Sitios web > Flash y Actionscript > Flex

Respuesta
 
Herramientas Desplegado
Antiguo 07-mar-2008, 19:51   #1 (permalink)
Sergestux no se puede cailificar en este momento
 
Avatar de Sergestux
 
Fecha de Ingreso: agosto-2007
Ubicación: Tijuas
Mensajes: 357
Enviar un mensaje por Yahoo  a Sergestux
Consultando base de datos

Hola veran aun no se nada de flex, pero modificando este codigo he logrado hacer este archivo mxml.

Código PHP:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
xmlns="*" creationComplete="send_data()">
    <mx:Script>
        <![CDATA[
            private function send_data():void {
                userRequest.send();
            }
        ]]>
    </mx:Script>
     <mx:DataGrid id="dgUserRequest" x="10" y="10" dataProvider="{userRequest.lastResult.ventas.venta}" width="458" height="330" editable="true">
         <mx:columns>
             <mx:DataGridColumn headerText="Sucursal" dataField="SucDesc"/>
             <mx:DataGridColumn headerText="Venta de Hoy" dataField="VentaHoy"/>
             <mx:DataGridColumn headerText="Venta S.A. a la misma Hora" dataField="VentaSaH"/>
             <mx:DataGridColumn headerText="Venta S.A. Todo el dia" dataField="VentaSaD"/>
             <mx:DataGridColumn headerText="Hora Ultima Venta" dataField="HoraUv"/>
         </mx:columns>
     </mx:DataGrid>
     <mx:HTTPService id="userRequest" url="http://localhost/VentasRango.php" useProxy="false" method="POST">
    </mx:HTTPService>
</mx:Application>


y mi script php, me devuelve estos datos:

Código PHP:
<html>
    <
head>
        <
title></title>
    </
head>
    <
body>
            <
ventas>
           <
venta><SucDesc>SUC1</SucDesc><VentaHoy>39,488.00</VentaHoy><VentaSaH>0.00</VentaSa><VentaSaD>0.00</VentaSaD><HoraUv>23:04:08</HoraUv></venta>
           <
venta><SucDesc>SUC2</SucDesc><VentaHoy>30,059.00</VentaHoy><VentaSaH>0.00</VentaSa><VentaSaD>0.00</VentaSaD><HoraUv>22:33:34</HoraUv></venta>
            </
ventas>    
       </
body></html
Uso el adobe builder para compilarlo y me genera el archivo flash, aparentemente hace la peticion al archivo php, ya que abajo me dice
"esperando loaclhost" pero de ahi me sale listo y no hace nada... disculpen la ignorancia de principiante.

Alguien que me ayude un poco, le estare muy agradecido
__________________
You'll be free, hackers, you'll be free
Sergestux está desconectado   Responder Citando
Antiguo 12-mar-2008, 16:52   #2 (permalink)
Sergestux no se puede cailificar en este momento
 
Avatar de Sergestux
 
Fecha de Ingreso: agosto-2007
Ubicación: Tijuas
Mensajes: 357
Enviar un mensaje por Yahoo  a Sergestux
Re: Consultando base de datos

Como nadie me responde, pondre lo que hice:
Era error en el formato del xml, asi quedo:

Código PHP:
<ventas>
    <
venta>
       <
SucDesc>SUC1</SucDesc>
        <
VentaHoy>39,488.00</VentaHoy>
        <
VentaSaH>0.00</VentaSa>
        <
VentaSaD>0.00</VentaSaD>
        <
HoraUv>23:04:08</HoraUv>
    </
venta>
   <
venta>
        <
SucDesc>SUC2</SucDesc>
        <
VentaHoy>30,059.00</VentaHoy>
        <
VentaSaH>0.00</VentaSa>
        <
VentaSaD>0.00</VentaSaD>
        <
HoraUv>22:33:34</HoraUv>
    </
venta>
</
ventas
__________________
You'll be free, hackers, you'll be free
Sergestux está desconectado   Responder Citando
Respuesta
No hay votos aún.


Herramientas
Desplegado

Normas de Publicación
No puedes crear nuevos temas
No puedes responder temas
No puedes subir archivos adjuntos
No puedes editar tus mensajes

BB code is Activado
Caritas están Activado
[IMG] está Activado
Código HTML está Desactivado


La Zona horaria es GMT -6. Ahora son las 22:30.


Message Board Statistics

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93