# loadClip inside the function()

**URL:** <https://forum.kirupa.com/t/loadclip-inside-the-function/126266>\
**Category:** Uncategorized\
**Created:** [October 21, 2004, 5:34pm UTC](https://forum.kirupa.com/t/loadclip-inside-the-function/126266 "2004-10-21T17:34:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chinesnegaum](https://avatars.discourse-cdn.com/v4/letter/c/db5fbb/32.png) [@chinesnegaum](https://forum.kirupa.com/u/chinesnegaum)\
**Post date:** [October 21, 2004, 5:34pm UTC](https://forum.kirupa.com/t/loadclip-inside-the-function/126266/1 "2004-10-21T17:34:03Z")

</div>

hello, i´m trying to make a loadClip (by MovieClipLoader) inside a function, but it doesn´t work…and I don´t know why…

please can someone help me?

this is the code that i´m try to use

//to create the class:

var carregador:MovieClipLoader = new MovieClipLoader();  
var ouvidor:Object = new Object();  
carregador.addListener(ouvidor);  
\_root.createEmptyMovieClip(“alvo”,100);  
alvo.\_x = 11  
alvo.\_y = 78  
link = “contato.swf”  
/_if I put the loadClip action here, the movie clip loads correctly, but I need to use this action inside the function…_/

//to use the loadClip inside the function:

function clipLoader () {  
count ++

this.onEnterFrame = function () {  
fundoMask.\_yscale = fundoMask.\_xscale  
fundo.\_yscale = fundo.\_xscale

if (fundo.\_xscale \<= 0) {  
aciona = true  
}  
if (aciona) {  
fundo.\_xscale = 20 + (fundo.\_xscale - 20)/1.2  
fundo.\_alpha = 50 + (fundo.\_alpha - 50)/1.2  
if (fundo.\_xscale \> 19.8) {  
[color=red]carregador.loadClip(link, alvo)[/color]  
}  
ouvidor.onLoadStart = function() {  
avisos = “carregando…”  
};  
trace(\_root.alvo.nome2.length)  
ouvidor.onLoadInit = function() {  
alvo.setMask(fundoMask)  
};  
ouvidor.onLoadComplete = function() {  
//avisos = “”  
fundo.\_alpha +=4  
fundo.\_xscale = tamanho + (fundo.\_xscale - tamanho)/1.058  
if (fundo.\_xscale \> 89) {  
fundoMask.\_xscale = 89 +(fundoMask.\_xscale - 89)/1.3  
}  
}  
ouvidor.onLoadError = function() {  
avisos = “ocorreu algum erro”  
};  
}  
}  
}
