# URLLoader Event.COMPLETE is not working

**URL:** <https://forum.kirupa.com/t/urlloader-event-complete-is-not-working/351949>\
**Category:** flash\
**Created:** [October 23, 2014, 10:30am UTC](https://forum.kirupa.com/t/urlloader-event-complete-is-not-working/351949 "2014-10-23T10:30:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lemolas](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@Lemolas](https://forum.kirupa.com/u/Lemolas)\
**Post date:** [October 23, 2014, 10:30am UTC](https://forum.kirupa.com/t/urlloader-event-complete-is-not-working/351949/1 "2014-10-23T10:30:30Z")

</div>

hi all,

as first, i want to say that i’m using Haxe that is a kind of emulator of AS

I’m having some issues with the listener Event.COMPLETE for the urlloader.  
It’s like the trigger is not working and the function is not called, i even tried to call different listener but none of them is working.  
Here’s my code:

```auto

var urlLoader : URLLoader;

public function new(apiURL) {
	super();
	this.urlLoader = new URLLoader();
	// json loader
	load_json(apiURL);
}

public function load_json(apiURL){
	this.urlLoader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
	this.urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
	this.urlLoader.addEventListener(ProgressEvent.PROGRESS, onProgress);
	this.urlLoader.addEventListener(Event.COMPLETE, onComplete);
	this.urlLoader.load(new URLRequest(apiURL + "?cachebust=" + Math.floor(100000+900000*Math.random()))); // for cache...
}
    
private function onComplete(e:Event) {throw "complete";}
private function onProgress(e:ProgressEvent) {throw "progree";}
private function onSecurityError(e:SecurityErrorEvent) {throw "error";}
private function onIOError(e:IOErrorEvent) {throw "io error";}

```

now, apiURL is surely filled and the url is parsed but none of those trigger is called,  
hope you can help because i’m going crazy!

Thanks!

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [October 23, 2014, 4:21pm UTC](https://forum.kirupa.com/t/urlloader-event-complete-is-not-working/351949/2 "2014-10-23T16:21:07Z")

</div>

Does “new” actually work for a function name? (I guess so with haxe, or maybe it represents the constructor… I guess that makes more sense. Been a while since I looked into haxe)

Are you testing this in a browser? Have you looked at networking in the console to see the progress of this file as its downloaded?
