Log in

View Full Version : Gallery code working inside of a mc



niksan8787
05-23-2009, 12:59 PM
Hei everybody,

I have this very simple problem:

I have my flash xml gallery which works perfectly. Now I just want to put the code inside of a MC (movie clip) so that I can manipulate the whole mc.

The problem is that after I put the code inside of the MC it doesn't work anymore.

I know it's a stupid question but I can't seem to figure it out.

I'd really appreciate your help, because I'm kind in a hurry with this project.

Thank you!

niksan8787
05-23-2009, 01:00 PM
import templateGallery.mvcgallery.*;
import templateLoader.mvctemplate.*
stop();

/////////////////////////////////////////////////////////////

var mc:MovieClip = this.createEmptyMovieClip("mc_container", 100);
mc._x = 0;
mc._y = 0;
var gallery:Gallery = new Gallery(mc);
m = gallery.__model;

/////////////////////////////////////////////////////////////

function loadDate(url_){
date = new XML();
date.ignoreWhite = true;
date.onLoad =Delegate2.create(this,this.onLoadedXml)
date.load(url_);
}

//////////////////////////////////////////////////////////

function onLoadedXml() {
create_gallery(date.firstChild)
};

/////////////////////////////////////////////////////////

function create_gallery(xml_:XMLNode){
var array = XML_.getArrayObject(xml_);
array.unshift("");
///////////////////////////////////
m.setData(array);
/////////////////
m.loadThumb();
///////////////////
//m.loadImage(1);

}

/////////////////////////////////////////////////////////////////////

if(_root==this){
loadDate("xml/gallery1.xml")
}else{
create_gallery(Loader.getInstance().__model.__dateTemplate.firstChild)
}

/////////////////////////////////////////////////////////////////////