# Access root functions problem

**URL:** https://forum.kirupa.com/t/access-root-functions-problem/278429
**Category:** flash
**Created:** [December 29, 2008, 11:03pm UTC](https://forum.kirupa.com/t/access-root-functions-problem/278429 "2008-12-29T23:03:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![spectator](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@spectator](https://forum.kirupa.com/u/spectator)
#### Post date: [December 29, 2008, 11:03pm UTC](https://forum.kirupa.com/t/access-root-functions-problem/278429/1 "2008-12-29T23:03:23Z")

</div>

Hi all :). I think I faced up a problem that I can’t solve. I have a swf file that is converted and working it is a small gallery with a menu. When I load this .swf file into another file everything is working. But I can’t access some of the functions of the root file where I loaded the gallery.

```auto
var myGLoader:Loader = new Loader(); 
addChild(myGLoader); 
var url5:URLRequest = new URLRequest("gallery.swf"); 
myGLoader.load(url5);

// gotoandplay function
function Move():void {
	gotoAndPlay("part1");
}

```

This is how I load the gallery.swf and I am using this to access the Move function from the gallery.swf inside.

```auto
function onClick(event:MouseEvent):void {
	trace(event.target.parent.parent.name);
	MovieClip(root).Move();
}

```

When I compile it I have no errors, but when it is loaded and I try to use the menu it gives me this

> TypeError: Error #1034: Type Coercion failed: cannot convert Program@1e25f281 to flash.display.MovieClip.  
> at mbc/onClick()  
> Where is the problem? Which is the best way to access a function from loaded movie? Thank you in advance 🙂
