# Moviecliploader inside a function

**URL:** <https://forum.kirupa.com/t/moviecliploader-inside-a-function/259160>\
**Category:** Uncategorized\
**Created:** [May 1, 2008, 4:07pm UTC](https://forum.kirupa.com/t/moviecliploader-inside-a-function/259160 "2008-05-01T16:07:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pier25](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pier25](https://forum.kirupa.com/u/Pier25)\
**Post date:** [May 1, 2008, 4:07pm UTC](https://forum.kirupa.com/t/moviecliploader-inside-a-function/259160/1 "2008-05-01T16:07:24Z")

</div>

I have this code but the only way it works is when I call the loadclip method from outside the function…

I’ve tried with \_root but I don’t know how acces the moviecliploader declared outside the function.

thanks

```auto

var cargador_loading:MovieClipLoader = new MovieClipLoader;

listener_cargador_loading = {};

listener_cargador.onLoadInit = function(){
       //actions
}
	
cargador_loading.addListener(listener_cargador);

function cargar_loading(){
       cargador_loading.loadClip(_root.ruta_loading,_root.cargando);
}

```
