# AS2 Dynamicaly loaded pic isn't woking if loaded from array

**URL:** <https://forum.kirupa.com/t/as2-dynamicaly-loaded-pic-isnt-woking-if-loaded-from-array/327571>\
**Category:** Uncategorized\
**Created:** [March 10, 2012, 2:07pm UTC](https://forum.kirupa.com/t/as2-dynamicaly-loaded-pic-isnt-woking-if-loaded-from-array/327571 "2012-03-10T14:07:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wolFM](https://avatars.discourse-cdn.com/v4/letter/w/d6d6ee/32.png) [@wolFM](https://forum.kirupa.com/u/wolFM)\
**Post date:** [March 10, 2012, 2:07pm UTC](https://forum.kirupa.com/t/as2-dynamicaly-loaded-pic-isnt-woking-if-loaded-from-array/327571/1 "2012-03-10T14:07:43Z")

</div>

Hi Guys!

Maybe that’s a simple problem, but doesn’t know what I’m doing wrong.  
If I doesn’t point the loaded picture name and they holding MovieClips with Array  
It’s working…,but when I try to use that loader for smoothing pic movement with it it’s get sytax error and that “The class or interface ‘BitmapData’ could not be loaded.”

Any help would be appreciated!

```auto
var pictures:Array = ["kep1.jpg","kep2.jpg","kep3.jpg","kep4.jpg","kep5.jpg","kep6.jpg","kep7.jpg","kep8.jpg","kep9.jpg","kep10.jpg","kep11.jpg","kep12.jpg","kep13.jpg","kep14.jpg","kep15.jpg"];
var mcNev:Array = ["kep1","kep2","kep3","kep4","kep5","kep6","kep7","kep8","kep9","kep10","kep11","kep12","kep13","kep14","kep15"];
var mcTemp:Array = ["tkep1","tkep2","tkep3","tkep4","tkep5","tkep6","tkep7","tkep8","tkep9","tkep10","tkep11","tkep12","tkep13","tkep14","tkep15"];
var i:Number = 0;

var vege:Number = 600;

var tavolsag = 10;

var sebesseg = 5;

function loadBitmapSmoothed(url:String, target:MovieClip) {

    var bmc:MovieClip = target.createEmptyMovieClip("bmc",target.getNextHighestDepth());
    var listener:Object = new Object();
    listener.tmc = target;
    
    listener.onLoadInit = function(mcTemp*:MovieClip) {
        mcTemp*._visible = false;
        var bitmap:BitmapData = new BitmapData(mcTemp*._width, mcTemp*._height, true);
        this.tmc.attachBitmap(bitmap, this.tmc.getNextHighestDepth(),"auto", true);
        bitmap.draw(mcTemp*);
    };
    
    var loader:MovieClipLoader = new MovieClipLoader();
    loader.addListener(listener);
    loader.loadClip(url, bmc);
}

function mozgatas():Void {
    if (this._y >= vege) {
        delete this.onEnterFrame;
        this.swapDepths(getNextHighestDepth());
        this.removeMovieClip();
    } else {
                if (this._y == 10) {
                ujkep();
        }
        this._y += sebesseg;
 }
}

function ujkep():Void {
    if (i<mcNev.length) {
    var dup:MovieClip = kep.duplicateMovieClip(mcNev*, getNextHighestDepth());
    mcNev*.createEmptyMovieClip(mcTemp*, mcNev*.getNextHighestDepth());
     dup._y = -150;
    loadBitmapSmoothed(pictures*, mcNev*.mcTemp*);
    dup.onEnterFrame = mozgatas;
    i++;
    } else {
        i=0;
        ujkep();
    }
    
}
ujkep();

```
