Welcome, Guest
  • Author Topic: browser test works fine, but swf is not getting the data  (Read 2329 times)

    carolsecco

    • Server what's that
    • *
    • Posts: 3
      • View Profile
      • Email
    Hello, I am some days before the deadline of a project, and I ve been for the last 5 days trying to upload my project to the web server. While it was local it was working fine.
    Uploaded to the server, with Apache + php 5 (I have never done that before, dont know much to describe it better..)

    Its ok when I call my metod in the /browser:
      
    • (Object)#1

        diadafeira = "quinta, dia 24 de maio."
        sepassou = "1"
      [1] (Object)#2
        diadafeira = "oioioio"
        sepassou = "0"



    But the text box that should out put this data in the swf remains blank,


    here is my as3 code wich I am developing in Flash cs5.5:


    var array:Array = [];

    var _netConnection2:NetConnection = new NetConnection();

    _netConnection2.connect("http://www.site.com.br/horta_virtual/amfphp/gateway.php");

    _netConnection2.call("HortalicasService/getData", new Responder(listData2, null));



    function listData2(dados2:Object):void
    {
          
       for( var item2:Object in dados2 )
           {
           array.push( { day: dados2[item2].dayfair, yes:dados2[item2].ifpast} )
             
           }
          
          onload();
    }   
       
    function onload()
     {
          
       for (var i:int= 0 ; i< array.length ; i++)
           {
          if ( array.yes==1)
           {
                data_txt.text= array.day
               }
             }
       
    }


    here is the php:

    <?php

    class HortalicasService2 {
       public function getData(){
           
        $conexao = mysql_connect('localhost', "db_loginl", "db_password") or die(mysql_error());
        $db = mysql_select_db("db_name")  or die(mysql_error());

            $query = "SELECT * FROM date";
           $resultado = mysql_query($query);
           $resultado_array = array();
           $i = 0;

           while ($dados2 = mysql_fetch_object($resultado)){
              

                    $resultado_array[$i] = array();

                    $resultado_array[$i]['diadafeira'] = $dados2->dayfair;
                    $resultado_array[$i]['sepassou'] = $dados2->sepassou;


                    $i++;
                
            }
            return $resultado_array;
        }

    }   

    ?>




    I have checked for spaces before anda after <?php...
    I have deleted the htaccess...
    And read lots of things..
    Dont know what else to do, would you guys kindly help me? thank you
    obrigada! =)
    « Last Edit: 05/28/12, 04:04 by carolsecco »

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Tryng to access http://www.site.com.br/horta_virtual/amfphp/gateway.php, I get a 404 error, so I guess you're not pointing to the correct address, or you forget to upload the amfphp library to the server

    Jorge

    carolsecco

    • Server what's that
    • *
    • Posts: 3
      • View Profile
      • Email
    Hey Joerge, sorry sbout the confusion, I have used a fake adress here, because de server contains some stuff that are not under my responsability, so I can't share it =\

    when I acces the gateway, I get the normal text:
    amfphp and this gateway are installed correctly. You may now connect to this gateway from Flash.


    Is there a way to export flash correctly, can I be doing it wrong?
    My swf is in the root, and the service is under amfphp/services, and everything that came with amfphp.zip is also there.

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Use Charles to sniff the back-end, charlesproxy.com. There you can see the returned stuff and probably errors

    Jorge

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    It is important, that the SWF is loaded from the same domain.
    Otherwise you receive a sandbox violation, but no data.

    Anyway - Charles will tell you this ;)
    happy flashing
    8)
    Ronald

    carolsecco

    • Server what's that
    • *
    • Posts: 3
      • View Profile
      • Email
    Thanks guys
    Im using Charles now, but I am not getting any errors!

    And the swf is in the same domain that amfphp is...
    =(

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    If you're not getting errors, you're getting the whole piece of information, check the request of the amfphp call. Check if the object have all the information you need, check the structure so you can access it, since probably you're tryng to access the wrong structure

    Jorge

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Depending on your service, there might be a level, you did not expect.
    Maybe there is a Item[0].variable or something alike.
    happy flashing
    8)
    Ronald