Hi,
Thanks for reading this thread. Am pretty new to AS3, so i might be asking silly question here…
I seriously have no idea if i wrote my script wrongly cause the preloader only appear after the image is loaded. so would really appreciate if someone can point out to me my mistake. Thanks
below is my code.
var preloader_mc:Mc_preloader
for (var i:Number = 0; i<15; i++) {
var productGroup:MovieClip = new MovieClip();
addChild(productGroup);
var variables:URLVariables=new URLVariables(myLoader.data);
var productImageArray:Array=variables.productImageThumb.split(" <|> ");
var productTitleArray:Array=variables.productTitle.split(" <|> ");
var productDesArray:Array=variables.productDesShort.split(" <|> ");
var productLoader:Loader = new Loader();
productGroup.y=i*130;
productLoader.load(new URLRequest("data/"+productImageArray*));
var productTitleText:TextField = new TextField();
productTitleText.width=370;
productTitleText.x=120;
productTitleText.y=0;
productTitleText.htmlText=productTitleArray*;
var productDes:TextField = new TextField();
productDes.width=370;
productDes.x=120;
productDes.y=productTitleText.height;
productDes.text=productDesArray*;
productGroup.addChild(productTitleText);
productGroup.addChild(productDes);
productGroup.addChild(productLoader);
productLoader.contentLoaderInfo.addEventListener(Event.INIT,addPreloader);
productLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
function addPreloader(evt:Event) {
preloader_mc = new Mc_preloader();
evt.target.content.parent.parent.addChild(preloader_mc);
preloader3_mc.x=60;
preloader3_mc.y=50;
}
function loadComplete(evt:Event) {
evt.target.content.parent.parent.removeChild(preloader3_mc);
}
}