# How to call function on class event handler

**URL:** <https://forum.kirupa.com/t/how-to-call-function-on-class-event-handler/235833>\
**Category:** flash\
**Created:** [August 15, 2007, 3:10am UTC](https://forum.kirupa.com/t/how-to-call-function-on-class-event-handler/235833 "2007-08-15T03:10:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marvelfj](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@marvelfj](https://forum.kirupa.com/u/marvelfj)\
**Post date:** [August 15, 2007, 3:10am UTC](https://forum.kirupa.com/t/how-to-call-function-on-class-event-handler/235833/1 "2007-08-15T03:10:03Z")

</div>

Hi friends…i have simple question about how to call a function on a class but i dont know how to do it, would you mind to help me,please.  
I have a class :

```auto

 
class MyClass{
  private var lvSendState:LoadVars;
  private var lvLoadState:LoadVars;
 
  public function Test(){
    trace("function Test Run");
  } 
      
  public function LoadSomeThing():Void{
    lvSend=new LoadVars();
    lvLoad=new LoadVars(); 
    lvSend.sendAndLoad("some url", lvLoad);
    lvLoad.onLoad = function(){
        //try to call function Test
       Test(); //This is doesn't work
    }      
 }
}
 

```

I try to call function Test on lvLoad.onload but i doesn’t work,does any body tell me how to call it :} ? thanks in advance
