# Oriented object programming

**URL:** https://forum.kirupa.com/t/oriented-object-programming/267558
**Category:** Uncategorized
**Created:** [August 2, 2008, 10:33pm UTC](https://forum.kirupa.com/t/oriented-object-programming/267558 "2008-08-02T22:33:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![danny0085](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@danny0085](https://forum.kirupa.com/u/danny0085)
#### Post date: [August 2, 2008, 10:33pm UTC](https://forum.kirupa.com/t/oriented-object-programming/267558/1 "2008-08-02T22:33:56Z")

</div>

I have a class to load an xml file:

package  
{  
import flash.events.\*  
import [flash.net](http://flash.net).\*

public class conexiones {

```
var loader:URLLoader = new URLLoader()
public static var xml_ruta:String;
public static var xml:XML;

public function cargarXML()	{
 loader.dataFormat = URLLoaderDataFormat.TEXT
 loader.addEventListener(Event.COMPLETE, onLoadXML)
 loader.load(new URLRequest(conexiones.xml_ruta)) }

public function onLoadXML(ev:Event)	{
 try {
  var myXML:XML = new XML(ev.target.data)
  conexiones.xml = myXML; } 

 catch (e:TypeError) {
    trace("Error: el formato del XML no es correcto!")
    trace(e.message) }	
 
}//fin function

```

}//fin clase  
}//fin paquete

and the main fla:

frame 1:

import conexiones  
var con:conexiones = new conexiones()  
con.cargarXML();  
trace("XML "+conexiones.xml); // null

frame 2:  
trace("XML "+conexiones.xml); // the xml value

but just in the second frame the conexiones.xml has a value

What am I doing bad ?
