1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
package photos
{
import com.greensock.events.LoaderEvent;
import com.greensock.loading.LoaderMax;
import com.greensock.loading.XMLLoader;
import flash.display.Loader;
import flash.display.Sprite;
import flash.net.URLRequest;
import src.G;
public class Photos extends Sprite
{
public function Photos(_xml:XML)
{
var _pile:LoaderMax = new LoaderMax( { name:'init_pile' } );
for (var i:int = 0 ; i < _xml.photo.length() ; i++) {
trace("fichier photo :", _xml.photo.fichier[i]);
_pile.append(new XMLLoader(_xml.photo.fichier[i], { name:'photos_xml' } ));
}
_pile.addEventListener(LoaderEvent.COMPLETE, pileComplet);
_pile.load();
}
private function pileComplet(e:LoaderEvent):void
{
G._photo_xml = LoaderMax.getContent('photos_xml');
}
}
} |
Partager