Hi All,
im making this site for a buddy of mine, everything started quite ok. But when i was trying to build in the banner images i bumoped into weird problems. At first my cs4 for pc stoppped working everytime so backup to cs3 this also stopped working everytime so i went working through guest account which seems to work ok.
ok back to the other problem. on this link you can see the website there is loading an image in the banner by an movieClipLoader this why i can adjust the image size when it’s done loading. I want to make everything sizeable. when the site loads for the first time the image won’t show, but when refreshing the site, suddenly the image does show. testing this all local works. But online not! so i tried testing local retrieving the images from the web. i got this sandbox error. oke added system.security.allowdomain("*") for the wildcard, really weird cause it’s just an image (bitmap) which is called
i think it has something to do with the way i load everything here’s some code
image.setMask(mask);
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
image.beeld._width = stageW;
image.beeld._yscale = image.beeld._xscale;
trace(":: BEGIN BANNER LOAD ::")
trace("IMAGE width"+image._width)
trace("IMAGE beeld width"+image.beeld._width)
}
mclListener.onLoadProgress = function (alvo, bLoad, bTotal){
procent = Math.round(bLoad / bTotal * 100);
progresso = bLoad / bTotal * Stage.width;
image.bgbeeld._width=progresso;
image.loadprocent.procent = procent +"%";
image.loadprocent._y = image.bgbeeld._y+15;
image.loadprocent.xSlideTo(image.bgbeeld._width-23,.5,"easeOutCubic",.8);
trace("::LOADING::")
};
mclListener.onLoadComplete = function (){
_root.SetItems();
image.loadprocent.xSlideTo(-30,.7,"easeOutCubic",1);
trace(":: EINDE BANNER LOAD ::")
trace("IMAGE width"+image._width)
trace("IMAGE beeld width"+image.beeld._width)
};
mclListener.onLoadError = function (){
trace (":: ERROR LOADING BANNER IMAGE ::");
};
function laadBannerimg(link){
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip(link, image.beeld);// EVENTUEEL GEBRUIKEN +"?nocache="+random(9999)
}
link="beelden/sunset_beach_low.jpg";
laadBannerimg(link);
stop();
this didn’t work so i tested further. Tonight i got this code to work local, but not on the net
mainURL=("http://www.playaportomari.com/new");
//image.setMask(mask);
stageW = Stage.width;
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
beeld._width = stageW;
beeld._yscale = image.beeld._xscale;
trace(":: BEGIN BANNER LOAD ::")
trace("IMAGE width"+image._width)
trace("IMAGE beeld width"+image.beeld._width)
}
mclListener.onLoadProgress = function (alvo, bLoad, bTotal){
procent = Math.round(bLoad / bTotal * 100);
progresso = bLoad / bTotal * Stage.width;
trace(progresso)
bgbeeld._width=progresso;
loadprocent.procent = procent +"%";
loadprocent._y = image.bgbeeld._y+15;
loadprocent.xSlideTo(image.bgbeeld._width-23,.5,"easeOutCubic",.8);
trace(progresso&&procent)
};
mclListener.onLoadComplete = function (){
_root.SetItems();
image.loadprocent.xSlideTo(-30,.7,"easeOutCubic",1);
trace(":: EINDE BANNER LOAD ::")
trace("IMAGE width"+image._width)
trace("IMAGE beeld width"+image.beeld._width)
};
mclListener.onLoadError = function (){
trace (":: ERROR LOADING BANNER IMAGE ::");
};
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
function laadBannerimg(){
image_mcl.loadClip(link[0], image.beeld);// EVENTUEEL GEBRUIKEN +"?nocache="+random(9999)
beel2._width =100;
//loadMovie(link,beeld);
}
link=["http://www.playaportomari.com/new/beelden/sunset_beach_low.jpg"];
laadBannerimg();
//loadMovie("http://www.playaportomari.com/new/beelden/sunset_beach_low.jpg",image.beeld);
stop();
if somebody could help me with this
oke… than i got the movieClipLoader to work. But when embedded into the site. where it’s scaled and moved it suddenly doesn’t show anymore
here’s the code which i use to center scale and all the other stuff
function SetItems(){
_global.stageW = Stage.width;
_global.stageH = Stage.height;
//beeldenbalk
//beeldenbalk._x = stageW/2-beeldenbalk._width/2;
bg._height = stageH;
bg._xscale = bg._yscale*2;
bg._x = stageW/2;
bg._y = stageH/2;
preloader._x = stageW/2;
preloader._y = stageH/2;
onderschrift._x = stageW/2;
beeldenbalk.image.beeld._width = stageW;
beeldenbalk.image.beeld._yscale = beeldenbalk.image.beeld._xscale;
if (introFinished=="true"){
beeldenbalk.ySlideTo(stageH/3-stageH/8,1,"easeInQuad");
beeldenbalk.mask._width = stageW;
beeldenbalk.mask._x = stageW/2;
beeldenbalk.mask._height = stageH/2+70;
beeldenbalk.mask.ySlideTo(stageH/3-30,1,"easeInQuad")
beeldenbalk.bg._width = stageW;
beeldenbalk.bg._x = stageW/2;
beeldenbalk.bg._height = stageH/2+80;
beeldenbalk.bg.ySlideTo(stageH/3-30,1,"easeInQuad")
beeldenbalk.image.beeld.ySlideTo(stageH/3-350,1,"easeInQuad")
beeldenbalk.image.beeld._width = stageW;
beeldenbalk.image.beeld._yscale = beeldenbalk.image.beeld._xscale;
/*trace(":: BANNER FOTO NA LADEN ::");
trace(":: BANNER FOTO WIDTH"+beeldenbalk.image.beeld._width)
trace(":: BANNER FOTO HEIGHT"+beeldenbalk.image.beeld._height)
trace(":: BANNER FOTO _x"+beeldenbalk.image.beeld._x)
trace(":: BANNER FOTO _y"+beeldenbalk.image.beeld._y)*/
beeldenbalk.bg.onTweenComplete = function(){
newplaats = beeldenbalk._y;
trace(newplaats)
logo.slideTo(stageW/2,newplaats/3+40,1,"easeInQuad")
navigatie.slideTo(stageW/2,stageH-70,1,"easeInQuad")
}
kleurenbalk._x = Stage.width/2;
kleurenbalk._width = stageW;
kleurenbalk.ySlideTo(-4,2,"easeInQuad");
onderschrift.spotlogo.xSlideTo(stageW/2-22,1,"easeInQuad");
onderschrift.audio.xSlideTo(-stageW/2+30,1,"easeInQuad");
onderschrift.ySlideTo(stageH-10,1,"easeInQuad");
onderschrift.fullscreenBTN.xSlideTo(-stageW/2+100,1,"easeInQuad");
}
}
i think im looking over something here, but im running creazy at the moment. help help help!
when i load the same image to the root it’s there.
link