# Photo Gallery and Loader();

**URL:** <https://forum.kirupa.com/t/photo-gallery-and-loader/237330>\
**Category:** flash\
**Created:** [August 29, 2007, 1:32pm UTC](https://forum.kirupa.com/t/photo-gallery-and-loader/237330 "2007-08-29T13:32:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![psilos](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@psilos](https://forum.kirupa.com/u/psilos)\
**Post date:** [August 29, 2007, 1:32pm UTC](https://forum.kirupa.com/t/photo-gallery-and-loader/237330/1 "2007-08-29T13:32:35Z")

</div>

Hello,

I want to create some photo gallery, but don’t know how in AS 3.0.  
Ok, if I want to load only one image I would do this:

```php

        still = new Loader();
        still.contentLoaderInfo.addEventListener(Event.COMPLETE, loadGallery);
        var url2:String = url+"_s"+ 1 + ".jpg";        
        var urlReq:URLRequest = new URLRequest(url2);
        still.load(urlReq);
        still.alpha = 0;
        if (!contains(still)) addChild(still);

```

Now, that I want to load all images I am doing something like that:

```php

    for(var i=1; i<=amount; i++){
        still = new Loader();        
        still.contentLoaderInfo.addEventListener(Event.COMPLETE, loadGallery);
        var url2:String = url+"_s"+ i + ".jpg";        
        var urlReq:URLRequest = new URLRequest(url2);
        still.load(urlReq);
        still.alpha = 0;
        still.y = i*10;
        addChild(still);
    }

```

So, now it seems to me that only the last pic appears when running, cause I am adding loader instead of loader.content.

Any Help???

Also, What I want to achieve is load first image and show directly, while the rest of them are loading in background.

Right now, with this for loop I have to wait for all the pictures to get loaded and then show them.

thanks very much in advance for any suggestions about the logic of Gallery in AS 3.0.
