# onData && #include

**URL:** <https://forum.kirupa.com/t/ondata-include/174452>\
**Category:** flash\
**Created:** [January 5, 2006, 9:04pm UTC](https://forum.kirupa.com/t/ondata-include/174452 "2006-01-05T21:04:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kBisk](https://avatars.discourse-cdn.com/v4/letter/k/eb8c5e/32.png) [@kBisk](https://forum.kirupa.com/u/kBisk)\
**Post date:** [January 5, 2006, 9:04pm UTC](https://forum.kirupa.com/t/ondata-include/174452/1 "2006-01-05T21:04:08Z")

</div>

Alright, I know that onData is used to send the raw contents of a text file to a text field…but can it be used along the lines of #include?

I have a .txt file with contents:

```auto
 
some_var = 1;
some_other_var = 2;

```

and now when I load those variables using:  
[AS]  
loadText = new LoadVars();  
loadText.load(“vars.txt”);  
loadText.onData = function(src){  
//some function using src  
}[/AS]  
If I use: trace(src) in the onData function, I see the variables like I want them to be. How do I get those variables to be set as if they were written in the actual flash actionscript? I know how to do it with text string manipulations…but that isn’t an option for this.

Thanks for any help.
