Published in: ActionScript
the first part goes on the clip where the banner will load. (banner size available: 500x100)
second part goes on an empty movie clip outside the frame
//FIRST PART onClipEvent (load) { _visible = false; lmax = 500; amax = 100; } //evento data è quando il 100% della clip caricata, è usato per loading di singole sezioni onClipEvent (data) { l = _width; a = _height; if (A>L) { h = amax; w = l*h/a; } else { w = lmax; h = a*w/l; } _x = (lmax-w)/2; _y = (amax-h)/2; _width = w; _height = h; _visible = true; } //SECOND PART: on a control mc outside the frame onClipEvent (load) { _root.stop(); fine = 0; tempo = 0; tempo0 = 0; i = -1; durata_banner = 5; loadVariables("lista.txt", this); } onClipEvent (enterFrame) { if (fine == 1) { s = new String(stringa); v = new Array(); v = s.split(":"); numero_banner = v.length; fine = 2; } if (fine == 2) { tempo = getTimer(); if (tempo-tempo0>durata_banner*1000 or i == -1) { i++; //i è l'indice del vettore, un trucchetto per far fare una sola volta if (i>=numero_banner) { i = 0; } _parent.banner.loadMovie(v[i]); tempo0 = tempo; } } }
You need to login to post a comment.
