Final Step TG :)

I have got the PHP code to do the correct query on my SQL download_counter table.



<?php  
error_reporting(E_ALL^E_NOTICE); 
require('connect.php'); 
$body=""; 
$result = mysqli_query("SELECT * FROM download_manager WHERE id = 'xx'");
$data = mysqli_fetch_assoc($result);
$result->close();
$body = '<b><font name="Teen" color="#009999" size="11">' . $data['DOWNLOADS'] . '</font></b> '; 
echo "returnBody=$body"; 
exit(); 
?> 


Now all I need is how to view it on my FLASH as3 MovieClip?

[AS]import flash.events.Event;
import flash.net.URLRequest;
import flash.net.URLVariables;
import flash.net.URLLoader;
var returnBody:String = “”;
var request:URLRequest = new URLRequest(“update.php?xx=1”);
var getVariables:URLLoader = new URLLoader();
getVariables.dataFormat = URLLoaderDataFormat.VARIABLES;
getVariables.addEventListener(Event.COMPLETE, completeHandler);
getVariables.load(request);
function completeHandler(event:Event):void
{
var urlVariables:URLVariables = new URLVariables();
var Ddata = urlVariables.decode(event.target.data);
dCounter.condenseWhite = true;
dCounter.textField.opaqueBackground = 0x333333;
dCounter.htmlText = “” + returnBody;
}
dload01.addEventListener(MouseEvent.MOUSE_OVER, dOver);
dload01.addEventListener(MouseEvent.MOUSE_OUT, dOut);
dload01.addEventListener(MouseEvent.CLICK, dClick);
function dClick (e:MouseEvent):void
{
navigateToURL(new URLRequest(“download.php?file=temp_01.zip”), ‘_self’);
}
function dOut (e:MouseEvent):void
{
dload01.gotoAndPlay(“out”);
}
function dOver (e:MouseEvent):void
{[/AS]

Hope someone can help with the as3 :slight_smile:
ps dCounter is the textfield>

Thanks
Steven :rd: