# Final Step TG :)

**URL:** https://forum.kirupa.com/t/final-step-tg/332205
**Category:** flash
**Created:** [March 2, 2014, 9:25pm UTC](https://forum.kirupa.com/t/final-step-tg/332205 "2014-03-02T21:25:04Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![scottiescotsman](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@scottiescotsman](https://forum.kirupa.com/u/scottiescotsman)
#### Post date: [March 2, 2014, 9:25pm UTC](https://forum.kirupa.com/t/final-step-tg/332205/1 "2014-03-02T21:25:04Z")

</div>

I have got the PHP code to do the correct query on my SQL download\_counter table.

```php

<?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 🙂  
ps dCounter is the textfield\>

Thanks  
Steven :rd:
