Welcome Guest, Not a member yet? Register   Sign In
Help with Adobe Flash and CodeIgniter URL
#1

[eluser]Unknown[/eluser]
Hi,

I'm new at developing with PHP and CodeIgniter and I have a question about using Adobe Flash and the CodeIgniter URL.

I'm using a controller to make an output of the database into XML format
Code:
function client()
    {
        $data['page'] = "client";
        
        $this->db->where('client_id', $this->uri->segment(3));
        $query = $this->db->get('portfolio');
        
        $xml_data = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
        $xml_data .= "<client>\n";
        
        if ($query->num_rows() > 0)
        {
            foreach($query->result() as $row):
                $this->db->where('gallery_id', $row->id);
                $query_image = $this->db->get('image');
            
                $xml_data .= "\t<portfolio>\n";
                $xml_data .= "\t\t<project id=" . '"' . $row->type_id . '"' .">" . $row->type ."<project>\n";
                $xml_data .= "\t\t<client id=" . '"' . $row->client_id . '"' .">" . $row->client ."<client>\n";
                $xml_data .= "\t\t<name>" . $row->name ."<name>\n";
                $xml_data .= "\t\t<gallery>\n";
                
                if ($query_image->num_rows() > 0)
                {
                    foreach($query_image->result() as $row_image):
                        $xml_data .= "\t\t\t<image path=" . '"' . $row_image->path . '"' . ">" . $row_image->name . "</image>\n";
                    endforeach;
                }
                
                
                $xml_data .= "\t\t</gallery>\n";
                $xml_data .= "\t</portfolio>\n";
            endforeach;
        }
        
        $xml_data .= "</client>";
        
        $data['xml_data'] = $xml_data;
        
        $this->load->view('portfolio', $data);
    }

With Actionscript I load the data into Flash
Code:
xmlloader = new URLLoader();
xmlloader.load(new URLRequest("http://www.mysite.com/index.php/portfolio/client/1"));

My question is: will the CodeIgniter URL work in Flash, or am I better off using the controller to write an XML file??

Thanks.
#2

[eluser]wowdezign[/eluser]
I have used URLs like the one in your example in my swfs and they worked for me.
#3

[eluser]Unknown[/eluser]
Thanks!
#4

[eluser]chazy (aldever calvo)[/eluser]
[deleted by chazy]
#5

[eluser]Unknown[/eluser]
Thanks wowdezign




Theme © iAndrew 2016 - Forum software by © MyBB