# Logical placements of .load() and .onload()

**URL:** https://forum.kirupa.com/t/logical-placements-of-load-and-onload/312926
**Category:** flash
**Created:** [August 16, 2010, 5:44am UTC](https://forum.kirupa.com/t/logical-placements-of-load-and-onload/312926 "2010-08-16T05:44:04Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![glisando](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@glisando](https://forum.kirupa.com/u/glisando)
#### Post date: [August 16, 2010, 5:44am UTC](https://forum.kirupa.com/t/logical-placements-of-load-and-onload/312926/1 "2010-08-16T05:44:04Z")

</div>

Hi Folks…

I got the following code from Adobe’s ‘Serverside ActionScript Language Reference’. Here it is:

```auto

myLoadVars = new LoadVars();
myLoadVars.onLoad = function(result){
    trace("myLoadVars load success is " + result);
}
myLoadVars.load("http://www.someurl.com/somedata.txt");

```

My questions is, if the purpose of the onload event handler is to confirm if the load operation is a sucess,than should it not be placed **after** the load command? In the above code, the onload event handler appears before the load and yet it works, I am wondering how this is possible? I hope someone can explain to me. Thanks guys.

regards  
glisando
