# Preload image within Class

**URL:** https://forum.kirupa.com/t/preload-image-within-class/151777
**Category:** flash
**Created:** [June 18, 2005, 12:25am UTC](https://forum.kirupa.com/t/preload-image-within-class/151777 "2005-06-18T00:25:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Idunno](https://avatars.discourse-cdn.com/v4/letter/i/e8c25b/32.png) [@Idunno](https://forum.kirupa.com/u/Idunno)
#### Post date: [June 18, 2005, 12:25am UTC](https://forum.kirupa.com/t/preload-image-within-class/151777/1 "2005-06-18T00:25:38Z")

</div>

Hello

This is my first post here and I already have a problem.

I have a class called _Gallery_ and within this class I want to generate thumbnails.  
I want to load the thumbnails with only one line of code to make it easy:

```php
this._mclContent.loadClip("mypicture.jpeg", "this.thumbs.myMC"); 

```

```php

var _mclContent:MovieClipLoader;
var _oListener:Object;

function Gallery() {
	  this._mclContent = new MovieClipLoader(); 
	  this._oListener = new Object();
	     this._oListener.onLoadStart = function(target_mc){
                trace(target_mc+"loading has started!");
        };
        
        this._oListener.onLoadProgress = function(target_mc, loadedBytes, totalBytes) {
        };
        
        this._oListener.onLoadInit = function(target_mc){
                trace(target_mc+" has finished loading");
        };
        
       this._oListener.onLoadComplete = function(target_mc){
				
        };
        
        this._oListener.onLoadError = function(target_mc, errorCode){
                trace(target_mc+" did not properly load: "+errorCode);
        };
        
        this._mclContent.addListener(this._oListener);
        this.createThumbnailObjects();
}

function createThumbnailObjects(){
       trace("start");
       this._mclContent.loadClip("mypicture.jpeg", "this.thumbs.myMC"); 
}

```

The problem is, that the code only traces “start” and not loads the clip. :hr:
