Hi

 

I try to listen to complet event on a Loader ( an array of)

 

this code don’t work :

 

 

var arrayLoader:Array = new Array ;

var arrayRequest : Array = new Array ;

 

for ( var b = 0; b< 10; b ++){

 

                var d :Loader = new Loader();

                var e : URLRequest = new URLRequest(“http://www.bases-as3.fr/images/tannoy.gif“)

                arrayLoader[b]= d;

 

                arrayRequest[b] = e

 

                arrayLoader[b].load(arrayRequest[b]);

 

                arrayLoader[b].contentLoaderInfo.addEventListener(Event.COMPLETE,lise nEvent);}

 

                    function lisenEvent(e : Event){

 

 

 

var cible = arrayLoader.indexOf(e.target)

trace ( cible) // always tace -1

}

 

 

But if you write the same code § or quite the same) with URLloader  with some diferences it woks and the number of the target is perfectely fired. But I want to load images so I have to use

Loader insted og URLLoader

|||

the target’s not the array.  it’s the loaderInfo.  use the loader property:

 

var cible=arrayLoader.indexOf(e.target.loader);

|||

Thanks kglad for these anwser

 

this is saving me hours of unproductive works

|||

you’re welcome.

Related posts:

  1. Having a problem on a certain website
  2. JQUERY PROBLEM causing big headache

Related posts brought to you by Yet Another Related Posts Plugin.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

   
© 2012 free icons download Suffusion theme by Sayontan Sinha

Featuring Recent Posts WordPress Widget development by YD