views:

121

answers:

1

Hello, I'm trying to load an external and local XML file to read its data, but I don't really know how to detect when the file has been loaded, I'm just able to open the broser window, here is what I have done package { import flash.display.Sprite; import flash.events.; import flash.net.; import flash.net.URLRequest;

public class cargadorXML extends Sprite {


 public var cuadro:Sprite = new Sprite();
 public function cargadorXML() {


  cuadro.graphics.beginFill(0xFF0000);
  cuadro.graphics.drawRoundRect(0,0,100,100,10);
  cuadro.graphics.endFill();
  cuadro.addEventListener(MouseEvent.CLICK,init);
  addChild(cuadro);

 }
 public function init(e:Event) {

  var file:FileReference;

  file = new FileReference();
  file.browse();
  file.addEventListener(Event.COMPLETE,bien);

 }
 public function bien(e:Event) {
  trace("cargado");
 }
}

}

but no "cargado" message appears, also I don't really think the Event.COMPLETE is the correct event at all xD could some one help me here?? thanks

A: 

done, it's Event.SELECT instead of Event.COMPLETE