All pastes #771916 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-11-13 10:49 UTC
rendered paste body
var tmp:MovieClip = _root.createEmptyMovieClip("Test", _root.getNextHighestDepth());
function createFDBItems(info) {
  for(i=0;i<info.length;i++) {
    nfo = info[i];
    
    imagesLoaded[nfo.id] = false;
    
    var mc:MovieClip = _root.attachMovie("scrollItem", "i"+i, _root.getNextHighestDepth());
    mc._visible = true
    mc._x = 300 * nfo.id;
    mc.id = nfo.id;
    mc.title_txt.text = nfo.title;
    mc.teaser_txt.text = nfo.teaser;
    mc.new_mc._visible = nfo.isNew == 1 ? true : false;
    mc.image_mc.loadMovie(nfo.image);
    mc.onEnterFrame = function() {
      if(this.image_mc.getBytesLoaded() >= this.image_mc.getBytesTotal()) {
        trace("Image loadedd"); // WORKS!!
        var FDB = new flash.display.BitmapData(this._width, this._height, true, 0xFFFFCC00);
        FDB.draw(this);
        trace(this); // _level0.iN where N == id of item.

        tmp.attachBitmap(FDB);
        tmp._y = 300;
        tmp._x = 300*this.id;
        trace(tmp); // _level0.TestN where N == id of test
        
        bitMaps.push(FDB);

        imagesLoaded[this.id] = true;
        delete this.onEnterFrame;
      }
    }
  }
}