# AS3 Loadvars problem, need help please

**URL:** https://forum.kirupa.com/t/as3-loadvars-problem-need-help-please/228494
**Category:** flash
**Created:** [June 8, 2007, 8:27am UTC](https://forum.kirupa.com/t/as3-loadvars-problem-need-help-please/228494 "2007-06-08T08:27:12Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Darth\_Neo](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@Darth\_Neo](https://forum.kirupa.com/u/Darth_Neo)
#### Post date: [June 8, 2007, 8:27am UTC](https://forum.kirupa.com/t/as3-loadvars-problem-need-help-please/228494/1 "2007-06-08T08:27:12Z")

</div>

Hi,

I’m mostly a designer and use AS to add some nice features on my sites. I have a Latest News section that I want to use with AS3 because AS3 supports images in textblocks. Now I get an error because of the Loadsvars statement. Can anyone help me with the proper AS3 code to get this working with AS3 please. Any help is very much appriciated.

var receiver:LoadVars = new LoadVars();  
news\_txt.htmlText = “loading news data…”;  
receiver.onLoad = function(ok){  
if(ok){  
news\_txt.htmlText = “”;  
for(var i =1;i\<=receiver.total;i++){  
receiver[“dataPacket”+i] = receiver[“news\_data”+(i)].split("|");  
var \_id:String = receiver[“dataPacket”+i][0];  
var \_title:String = receiver[“dataPacket”+i][1];  
var \_body:String = receiver[“dataPacket”+i][2];  
var \_posted:String = receiver[“dataPacket”+i][3];  
delete(receiver[“news\_data”+i]);  
news\_txt.htmlText += (\_title + “\<br/\>” + \_body + “\<br/\>” + \_posted + “\<br/\>\<br/\>”)  
}  
}else{  
news\_txt.htmlText = “no news data was found!”;  
}  
}  
receiver.load(“[http://www.yourserver.com/get\_news.php](http://www.yourserver.com/get_news.php)”);

The error I get is:

1046: Type was not found or was not a compile-time constant: LoadVars.

TIA,

Darth Neo
