So far I have this file called getxml.php
<?
$url=$_GET["u"]?urldecode($_GET["u"]):"xml.weather.yahoo.com";
$path=$_GET["p"]?urldecode($_GET["p"]):"/forecastrss";
$qs=$_GET["q"]?urldecode($_GET["q"]):"?p=THXX0002&u=c";
$fp = fsockopen ($url, 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET ".$path.$qs." HTTP/1.0\r\n";
$out .= "Host: ".$url."\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
$str.=fgets($fp, 128);
}
fclose($fp);
}
$str=substr($str,strpos($str,'<?xml'));
print $str;
exit;
?>
and I have also this action in flash:
// go to
http://weather.yahoo.com, find the page for the city you
// want to use and then copy the link to the RSS feed. make sure you
// grab the RSS link and not the link to the HTML page. it should look
// something like this...
feedURL = "http://www.asagroupltd .com/getxml.php";
// include the script to grab the XML data and import it into the flash movie
#include "scripts/content.as"
feedURL = "http://www.asagroupltd .com/getxml.php";
feedURL = "http://www.asagroupltd .com/forecastrss.php";
// fire event to display current weather conditions
dispatchEvent({type:"containerInit", target:this});
// when button is pressed, shift it's position
function btnPressed(btn) {
btn._x += 1;
btn._y += 1;
}
// when button is released, put it back
function btnReleased(btn) {
btn._x -= 1;
btn._y -= 1;
}
and it gives me an output of weather in flash as you can see here : asagroupltd .com .
It is working perfectly but I need to add extra option so the user can click a dropdown menu and it can also display the weather by country they choose in the dropdown menu. I have been told I need to creat a drop down combobox and dont know much about this, but will post an additional thread if I have to regarding combobox, but as for this thread I would like to know what I would need to add to the current code to pull additional weather results for the country location.
Thank you