Ask a Question related to Macromedia Flash Data Integration, Design and Development.

  1. #1

    Default php to xml

    hello, I work normally only with Dreamweaver and Database, I now want to work
    with a flash-movie integrated into my php-site. The flash movie gets data from
    a xml-file "index.xml". . I managed to make a php-file which becomes a xml-file
    (if I understood right..?) and called it "index.php". But the Flash-file does
    not find that.
    I wonder what I have to change. In the Flash-file or in the PHP?


    <?php

    header("Content-type: text/xml");

    $host = "localhost";
    $user = "username";
    $pass = "password";
    $database = "db";

    $linkID = mysql_connect($host, $user, $pass) or die("Could not connect to
    host.");
    mysql_select_db($database, $linkID) or die("Could not find database.");

    $query = "SELECT * FROM home LIMIT 0, 9";
    $resultID = mysql_query($query, $linkID) or die("Data not found.");

    $xml_output = "<?xml version=\"1.0\"?>\n";
    $xml_output .= "<item>\n";

    for($x = 0 ; $x < mysql_num_rows($resultID) ; $x++){
    $row = mysql_fetch_assoc($resultID);
    $xml_output .= "\t<item>\n";
    $xml_output .= "\t\t<idder>" . $row['id'] . "</idder>\n";
    $xml_output .= "\t\t<title>" . $row['title'] . "</title>\n";
    $xml_output .= "\t\t<link>http://www.content.php?id=" . $row['link'] .
    "\t?expandable=" . $row['menuLink'] . "</link>\n";
    $xml_output .= "\t\t<enclosure url='images/" . $row['doc'] . "' type='" .
    $row['ext'] . "'/>\n";
    $xml_output .= "\t</item>\n";
    }

    $xml_output .= "</item>";

    echo $xml_output;

    ?>

    Ulitasch Guest

  2. #2

    Default Re: php to xml

    Hi

    There is a tutorial [url]http://www.gotoandlearn.com[/url] that will show you how to do it.
    Its called PHP, MySQL and Flash.

    Hope it helps
    The Feldkircher Guest

  3. #3

    Default Re: php to xml

    Thanks a lot!!!:)
    This helps to understand the integration..

    But I got a Flash-file (with many actionscripts) where I just would need to
    change the XML-file to be filled with database-data. Do I really have to go
    deep into the actionscripts to make changes or is there a way to just change
    the existing XML-file?

    Ulitasch Guest

  4. #4

    Default Re: php to xml

    Hi

    All you have to do is for example myXML.load("index.php")

    Flash doesn't car its a php file, it thinks its just a regular xml file.

    Once loaded, then you can pull the data from each node however you like.

    Hope it helps

    The Feldkircher Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

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 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139