# LoadVars inside class - how?

**URL:** <https://forum.kirupa.com/t/loadvars-inside-class-how/43097>\
**Category:** flash\
**Created:** [February 18, 2004, 8:29pm UTC](https://forum.kirupa.com/t/loadvars-inside-class-how/43097 "2004-02-18T20:29:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaKa](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@MaKa](https://forum.kirupa.com/u/MaKa)\
**Post date:** [February 18, 2004, 8:29pm UTC](https://forum.kirupa.com/t/loadvars-inside-class-how/43097/1 "2004-02-18T20:29:54Z")

</div>

How can I use LoadVars inside a class?  
I mean, if I assign the method name to onLoad of LoadVars, the method will be override, and will not pertence to my class.  
look this:

[AS]  
class myClass{  
var lv:LoadVars;  
function myClass(){  
lv = new LoadVars();  
lv.onLoad = onLoad;  
}  
function onLoad(sucess:Boolean):Void{  
trace(this);  
}  
function trigger(){  
lv.sendAndLoad(“testeURL”,lv,“POST”);  
}  
}  
[/AS]  
this at onLoad function points to loadVars not to myClass.

the only solution I found to this was to myClass extends LoadVars, but it limit me since AS 2 does not support multiple-Inheritance.

I think I will face the same problem with all others components that does not has addEventListener capabilitie.:red: :red:
