# Transition alpha between external swf(need preload)

**URL:** <https://forum.kirupa.com/t/transition-alpha-between-external-swf-need-preload/190409>\
**Category:** Uncategorized\
**Created:** [June 11, 2006, 2:41pm UTC](https://forum.kirupa.com/t/transition-alpha-between-external-swf-need-preload/190409 "2006-06-11T14:41:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogerB](https://avatars.discourse-cdn.com/v4/letter/r/d9b06d/32.png) [@rogerB](https://forum.kirupa.com/u/rogerB)\
**Post date:** [June 11, 2006, 2:41pm UTC](https://forum.kirupa.com/t/transition-alpha-between-external-swf-need-preload/190409/1 "2006-06-11T14:41:03Z")

</div>

Hi  
I did a flash movie with this code

////inizializzo le movie clip gallery\_target 1 e 2  
gallery\_target1.\_alpha = 0;  
gallery\_target1.attivo = false;  
gallery\_target2.\_alpha = 100;  
gallery\_target2.attivo = true;//non sarebbe necessario settarla perchè se è attiva la 1 ovviamente non lo è la 2…

///definisco la funzione per caricare l’swf, funzione che verrà richiamata dai bottoni  
function carica(file) {  
if (!gallery\_target1.attivo) {  
//questa mc è inattiva, quindi carico l’swf in questa mc  
var galleria\_Vuota:MovieClip = gallery\_target1;  
} else if (!gallery\_target2.attivo){  
//questa mc è inattiva, quindi carico l’swf in questa mc  
var galleria\_Vuota:MovieClip = gallery\_target2;  
}  
//trace("Carico “+file+” in "+galleria\_Vuota);  
loadMovie(file,galleria\_Vuota);  
}

//definisco la funzione scambia, richiamata in automatico della mc gallery quando l’swf è caricato.  
function scambia(mc) {  
//blocco i movimenti di entrambe le mc e risetto quella che mi interessa  
\_root.gallery\_target1.onEnterFrame = null;  
\_root.gallery\_target2.onEnterFrame = null;  
if (mc == \_root.gallery\_target1) {  
//trace(“Scambio 2 con 1”);  
mc.onEnterFrame = function() {  
valore\_crescente = this.\_alpha;  
trace(valore\_crescente);  
if (valore\_crescente\<100) {  
valore\_crescente +=10;  
\_root.gallery\_target1.\_alpha = valore\_crescente;  
\_root.gallery\_target2.\_alpha = 100-valore\_crescente;  
} else {  
this.onEnterFrame = null;  
\_root.gallery\_target1.\_alpha = 100;  
\_root.gallery\_target2.\_alpha = 0;  
}  
}  
\_root.gallery\_target1.attivo = true;  
\_root.gallery\_target2.attivo = false;  
} else if (mc == \_root.gallery\_target2) {  
//trace(“Scambio 1 con 2”);  
mc.onEnterFrame = function() {  
valore\_crescente = this.\_alpha;  
trace(valore\_crescente);  
if (valore\_crescente\<100) {  
valore\_crescente += 10;  
\_root.gallery\_target1.\_alpha = 100-valore\_crescente;  
\_root.gallery\_target2.\_alpha = valore\_crescente;  
} else {  
this.onEnterFrame = null;  
\_root.gallery\_target1.\_alpha = 0;  
\_root.gallery\_target2.\_alpha = 100;  
}  
}  
\_root.gallery\_target1.attivo = false;  
\_root.gallery\_target2.attivo = true;  
}  
}

//setto i tre bottoni  
bottone1.onRelease = function () {  
carica(“company.swf”);  
}  
bottone2.onRelease = function () {  
carica(“dovesiamo.swf”);  
}  
bottone3.onRelease = function () {  
carica(“contatti.swf”);  
}  
bottone4.onRelease = function () {  
carica(“news.swf”);  
}  
bottone5.onRelease = function () {  
carica(“cornicipelle.swf”);  
}

this external script loaded swf exchanging them between with they  
Now I would want to insert a preload, than extension that is loading  
the other swf  
Some solution for me? Help me is very very urgent
