Hjælp til IF sætning
Hej Med Jer.Jeg er igang med at lave et billed galleri hvor forskellige jpg's skal loade ind i hinanden. Jeg sidder med et script som kan loade 2 forskellige jpg's ind og det virker - men jeg skal have en 10-13 billeder pr. sektion.
Jeg tror at det er i denne if sætning det går galt og jeg skal have container3_mc, container4_mc, container5_mc placeret. Er der nogle som kan gennemsku kunne det være fedt med lidt hjælp.
Script i frame:
// this is the event handler for each container's
// onPreloaderComplete event - a custom event invoked
// in the preloadContents function
function preloadComplete(){
// swap the depths of the containers putting the
// one who just got new content at the top
container1_mc.swapDepths(container2_mc);
// check the depths of the 2 containers and assign
// bottomcontainer to the new lowest container
if (container1_mc.getDepth() < container2_mc.getDepth()){
bottomcontainer = container1_mc;
}else{
bottomcontainer = container2_mc;
}
// remove the preloader animation
preloader_mc.removeMovieClip();
// set the onEnterFrame event to fade in this container
this.onEnterFrame = fadeIn;
}
// this function fades in a container
// once its content has loaded
// it is to be used with onEnterFrame
function fadeIn(){
// if the alpha is less than 100, fade in
if (this._alpha < 100){
// increase using a rate of 5
this._alpha += 5;
}else{
// delete the onEnterFrame event handler
// running this fadeIn method
delete this.onEnterFrame;
}
}
// set onPreloaderComplete functions (event handlers)
// for each container to the preloadComplete function
// when a container is completely loaded, preloadContents
// will call onPreloaderComplete for the container which
// will run preloadComplete because of these definitions
container1_mc.onPreloaderComplete = preloadComplete;
container2_mc.onPreloaderComplete = preloadComplete;
